Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2462955imj; Mon, 18 Feb 2019 06:28:18 -0800 (PST) X-Google-Smtp-Source: AHgI3IbT02bqOxkLbT7IHFSep1086bNSg+YLM/VRS5eaZIq7qq6HpvV+thCUQXe8IqK0LOLUqGdp X-Received: by 2002:a63:c310:: with SMTP id c16mr504281pgd.233.1550500098347; Mon, 18 Feb 2019 06:28:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550500098; cv=none; d=google.com; s=arc-20160816; b=KOWkjb+AnHokwzGxKDQQC1WtmqSmlxtXl2S8QqxfckaXjTxm7v5u55vJqU7ClgeYFP 2UdyWylRcfky9qYFBvA/nMVmSzS7XDQryyiRnorTzlITjJOZM/oz3kEq5nooANXqkG40 sPkVq/nmMmAzc+iz45Sj/nDWjlkSZs7kKT2egPRj0lDha5lR4f8DqYTQWlfj35wNA5Sa 4QtqORjCiEQDnwKWodjc297ftPEn7VINsIBRkpxV1bSbaxrAiUMK9mggok0170zB7xks bXUdzd8VHSVfy6LkNTard/tvJtXXLt9RJwIAONXdG0hJe5N6zvh7myC2jVHD9lEsOSyr 9lxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=puk1PkvdCDwNPJSvGIl2hdsjyCSn75xWvwFgW2NSfj8=; b=s4bPyWXXRFAjwrfTC2atr8sYPL0wHIJd56HjUBubmj4PdOj2BBeNFNFRiCQOp6Q+WX sUkD/wUlx9Qvsyt3YvGv6w6ubaf7mX3/pjcS014A9Jjnigd4ZEhWrLSWfIJydcLUrReC cSx3c65w0hrhyuIvRKQ8aXvYa1oTjdQo2Sxvqq9kfftZzgCCfb1hEkSBWRML6s1tiAnu /JBFVL4Vai89/7zMwBBJ0DFRmxgOmK61JPQ7AdwDIgm6nXy1esIfO4lS+CbDZ7wnLOsr DcjhvHDER0yY6CzKKSGJya/Yo7GE4qKo2Ogjts4YrnTIitjCVO4623/4oeSZC2ulEQJA GoSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VlR6TwMz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g5si13438984plo.108.2019.02.18.06.28.02; Mon, 18 Feb 2019 06:28:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VlR6TwMz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730325AbfBROZe (ORCPT + 99 others); Mon, 18 Feb 2019 09:25:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:45330 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389652AbfBRODY (ORCPT ); Mon, 18 Feb 2019 09:03:24 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 107762070D; Mon, 18 Feb 2019 14:03:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550498603; bh=M2puCQdhACYHsrKbUl5tJKmwlLEmIUdyqy4JXmdvpJc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VlR6TwMzHidUsesgXCr0BKENjulbH+Ijv8ibjwWXc6S/lGmYfJddF60IdAPe68+uH h0BZ8zw5jBrJrSzZCh+G4Tn1PuaGmhZ8OWzGCgCqVP2o3Zf+O69DM4/Uwup2ONxCNl cT6Ck3bWY5DQEf5rY5hCMTsv5IsB3rjCyUxkttbk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hedberg , Luiz Augusto von Dentz , Marcel Holtmann , Sasha Levin Subject: [PATCH 4.4 044/143] Bluetooth: Fix unnecessary error message for HCI request completion Date: Mon, 18 Feb 2019 14:42:52 +0100 Message-Id: <20190218133530.751032594@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218133529.099444112@linuxfoundation.org> References: <20190218133529.099444112@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 1629db9c75342325868243d6bca5853017d91cf8 ] In case a command which completes in Command Status was sent using the hci_cmd_send-family of APIs there would be a misleading error in the hci_get_cmd_complete function, since the code would be trying to fetch the Command Complete parameters when there are none. Avoid the misleading error and silently bail out from the function in case the received event is a command status. Signed-off-by: Johan Hedberg Acked-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- net/bluetooth/hci_event.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index d40d32a2c12d..37fe2b158c2a 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -5185,6 +5185,12 @@ static bool hci_get_cmd_complete(struct hci_dev *hdev, u16 opcode, return true; } + /* Check if request ended in Command Status - no way to retreive + * any extra parameters in this case. + */ + if (hdr->evt == HCI_EV_CMD_STATUS) + return false; + if (hdr->evt != HCI_EV_CMD_COMPLETE) { BT_DBG("Last event is not cmd complete (0x%2.2x)", hdr->evt); return false; -- 2.19.1