Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp222669pxb; Mon, 13 Sep 2021 17:34:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHGKn4MarPzz4v0AgVkgh5CsFXFocJyuTzqwiVx0ndd8YckMeFe5ZO+zb8NDPOy+7U2hsq X-Received: by 2002:a05:6402:42d4:: with SMTP id i20mr10636755edc.348.1631579666888; Mon, 13 Sep 2021 17:34:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631579666; cv=none; d=google.com; s=arc-20160816; b=wV/JEYUc2BP7yj0lpxNRT5tfmHnAWkeub8fPJybPhm5w38thAjaHJBtQTRItMB+br8 wbkSvnoVANNkjRToEp2RSMIYVWeKmt1sMBQDoO6i5RfVJbXcvs9IEFRVqIab9CbeKL0S vUxky45e3KZNfGBBojecHRQE5sXjdmC/moipuq2/TbA9EDaarXYmG+bioPwDfYpVfOzz Dc9y9VCeYDsLr9wuPajcWzsNgdeP4lVAep7a+qduyMhv1IXDD6UW42wOXfsaxosovuR3 VpMgP4M4LgI2tPdjurhWCzbuOObwJsFnpUWeznhZPOnAvMQiChgidDULWKheZEZZ41v4 JJ/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DUpKbE4eyg+L5MovBtpEYe35CvmtThcXHr3nqGgIeb0=; b=PdxeZaqcl0giWwmyzIAH1QugRckemSOu303PFtUU6TSwKU4NuaZ26/10EIaPuVioLu eEPakLHjYDaQ/V2aKd6Zy/jrUWKuk6eGFNR79b9Hu8ThoNENUEJB/dY9ANG45VLK2gpe Wi6AiZu8L5E80jivxJ21hGjH3rC3sD10pCu4Mx5MLwzCXB0CR4RMPWkzrZjEhzjdv92d I5FozqhC6h2Rr3nbsHQT77N5sSlnsnN40H1uwOTdPluhaiL5qdFlC8tXeZGN/RI7YmrI SVw+PbvxyeObiXeHFdunogrHIl9tPoOqJGrfYCaB8vR4gcqWPfG9jTa7F6VHZmz28EK0 684g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CupWcnGF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g11si8677081edb.40.2021.09.13.17.33.58; Mon, 13 Sep 2021 17:34:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CupWcnGF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345732AbhIMOck (ORCPT + 99 others); Mon, 13 Sep 2021 10:32:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:51038 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344780AbhIMO2b (ORCPT ); Mon, 13 Sep 2021 10:28:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7F5A161B61; Mon, 13 Sep 2021 13:50:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631541002; bh=au6tdu5mnSA7gUeuzh/WYg1gf/zwi0eeaZEPu9fhJB8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CupWcnGFr4yNcvd0eC5wSiyCBJXhcQrUHsE9cMKE8vNLbWfbJyEUneaDgc0zjyt9T D/ujD5/3j5mF3631xy0V9BPGiB+T7MOIZ0g0PStlzCpWOxFHfD2fx5mwJsZla8svZu whH/CqJIYh7dQS46XWcHW1TqtJEgZ1w+NpAuSKbE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jun Miao , Marcel Holtmann , Sasha Levin Subject: [PATCH 5.14 122/334] Bluetooth: btusb: Fix a unspported condition to set available debug features Date: Mon, 13 Sep 2021 15:12:56 +0200 Message-Id: <20210913131117.498076291@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131113.390368911@linuxfoundation.org> References: <20210913131113.390368911@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jun Miao [ Upstream commit 20a831f04f1526f2c3442efd3dece8630216b5d2 ] When reading the support debug features failed, there are not available features init. Continue to set the debug features is illogical, we should skip btintel_set_debug_features(), even if check it by "if (!features)". Fixes: c453b10c2b28 ("Bluetooth: btusb: Configure Intel debug feature based on available support") Signed-off-by: Jun Miao Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- drivers/bluetooth/btusb.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 0255bf243ce5..bd37d6fb88c2 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -2921,10 +2921,11 @@ static int btusb_setup_intel_new(struct hci_dev *hdev) /* Read the Intel supported features and if new exception formats * supported, need to load the additional DDC config to enable. */ - btintel_read_debug_features(hdev, &features); - - /* Set DDC mask for available debug features */ - btintel_set_debug_features(hdev, &features); + err = btintel_read_debug_features(hdev, &features); + if (!err) { + /* Set DDC mask for available debug features */ + btintel_set_debug_features(hdev, &features); + } /* Read the Intel version information after loading the FW */ err = btintel_read_version(hdev, &ver); @@ -3017,10 +3018,11 @@ static int btusb_setup_intel_newgen(struct hci_dev *hdev) /* Read the Intel supported features and if new exception formats * supported, need to load the additional DDC config to enable. */ - btintel_read_debug_features(hdev, &features); - - /* Set DDC mask for available debug features */ - btintel_set_debug_features(hdev, &features); + err = btintel_read_debug_features(hdev, &features); + if (!err) { + /* Set DDC mask for available debug features */ + btintel_set_debug_features(hdev, &features); + } /* Read the Intel version information after loading the FW */ err = btintel_read_version_tlv(hdev, &version); -- 2.30.2