Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2719474imj; Mon, 11 Feb 2019 07:28:26 -0800 (PST) X-Google-Smtp-Source: AHgI3IZto5VOgDYWmz0aomwiMdsp4y7+9d7paF4nmPA7G8tB2qSNs8uLVCmBJ+iTH+JxeC1EjgDo X-Received: by 2002:a17:902:e087:: with SMTP id cb7mr33048429plb.313.1549898905926; Mon, 11 Feb 2019 07:28:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549898905; cv=none; d=google.com; s=arc-20160816; b=trqdMOlADUOtGc1iLIBvqp5917cywrbXoH+MBcPVbn/4z7Nsjg0wzX0zxrb6BhOxnG 6yKIZGCC0KRsoCW7oKulcFFI99AnSOOleUGyoey5uxMR+IPOAgNEmZhKZswLX29Y0KoL IlwrSXFpWUhu/1lgZd23Ol3iuV7t8nj8LJSv8kYtQpxLZDlUvIZwAfn7t9o9EEjur2Ux 9Ytorz3E/eh6qo8u2S3ULnu4pNoqTCtovMNbFCz4Q6d8nKdSIlpBIDpXON4V9dTv/10A Kcw0h9bASEuDDSRLPGOB32ztN2GoTNDcL8gU1SdaVuWPAcCVNW00vn2HKTJvMau6fhCm MJEw== 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=KwNfq+QeKAhKQLTWVtaMoRHGjqDCE98YHK2EQiyqYAE=; b=K1tEqzTfDnwJ/dG09tC1wnET5Gx2rcpxG1OaMlpvAQqSj5IgOFl4bX/4psYD+Y7KW0 qyvul292STG75Z/IkfvgUDJ9ydV2fgNNabrmIH8MAibk8C0GiYWyBD/9K+XTk5y5tEeN RGCFlgXMXvGQGY1bdebxuh/wfdi07TgzMDX9E+PblKxAKMBP3DkPn30mt5tolzZ7T41o ZuZPMwQnhO2nY3yYfvEkw9kyVVGIA9vTHI0THmuvEVIrFDpnYJrF6zpDGL8PcykYIJCz rdi+uaVf0eqmqw4sLmeypsa8bQklxsv1LamWr+umGu2bnB5P+RZz4MHjoLFDFNS12qjC mIYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NV1JbxPm; 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 o73si10449076pfa.137.2019.02.11.07.28.08; Mon, 11 Feb 2019 07:28:25 -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=NV1JbxPm; 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 S2389101AbfBKO71 (ORCPT + 99 others); Mon, 11 Feb 2019 09:59:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:47138 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389791AbfBKO7X (ORCPT ); Mon, 11 Feb 2019 09:59:23 -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 E351C21773; Mon, 11 Feb 2019 14:59:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549897163; bh=rJeAMNGzgPkoG+71rXsetXbE0pOTUPdXZrd4hUuP93o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NV1JbxPmTXBxBR2ODLjZnRwi28MpZkOeBz9SJaUHmnCvI5pmynLI5neWflGHDsKyE oPShkNPE3vx62SBar4+bADnwc6CHlbPwhPDih8GD/+LyLiOfpCTia4WCAw7znmvYy4 O3vXXCqpYm3w7e4UMKAIh7sPso21b2WCGfskjSaE= 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.14 111/205] Bluetooth: Fix unnecessary error message for HCI request completion Date: Mon, 11 Feb 2019 15:18:29 +0100 Message-Id: <20190211141835.769833971@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141827.214852402@linuxfoundation.org> References: <20190211141827.214852402@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.14-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 01f211e31f47..363dc85bbc5c 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -5212,6 +5212,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