Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1859901pxb; Mon, 13 Sep 2021 07:05:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwp/8bJ25QlncGbBsmNJbgizsTrFY+6GQw053fRd57TmuwUtxMWx1Qf0ICRzoAa4rW8iGvJ X-Received: by 2002:a17:906:165a:: with SMTP id n26mr12623446ejd.236.1631541959108; Mon, 13 Sep 2021 07:05:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631541959; cv=none; d=google.com; s=arc-20160816; b=m9aqgIbTR2XhNxi0aANj6OUN/F60XRO4z85zCbGMCYh5BDHj6VPFr9vC/SvYMcY6xH N6MfGUt4wvtdUExrJ66CKV7jLrMV5+IazOfDZY/+a23Tfpp17oqPpz5fQg+t1b7qkLbr vLXPo5ul+MB7OIG/5lRazzDN1b6iz48aHL0ZLzvUmpd9ctDHzvGO9+AvdVIRY+s1G6Jk TwOERfJYtRSRhc8yv578DF3MtvDs4uRNeeIEkF2p7LHCjfXMI7Ju4ajlaRgxKpSrwUC9 Lg6SArNi735gQNXbrYqqsQcFGlZulyhqkoesfb2wjDBawmVqzORe4YYeu1b6uRRfKPwI /cTw== 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=41FUxk1wYRKBIhgaCmPp8Y5LCIiNFs80YD85nSR0hkw=; b=oFRLMFDk46l7O0Y8ED5pybfzCwulMYfGgIEazVjIgaomrViTD11bICOkxo6J8z9ewg L3P7KFrbOXfiqI7MN6rKW4K+ih6aFcCKIP3fmdHg9Z6SFR4UzlAyIpqrzzDxpmg5JPLH KxzsE4AWUZh7kQR7mBF2AFnKclpQS0cIIHl3HungwjS0WDW0JCpgcUSQVYQxNvoc+591 C6kzfGkn4nbvMQp94RhB0FWFo78L9/eHM76ElGuC5GqPiuwlo+/GiCB1SOEG4DcEHkFO Mq+MHy2s+ujX5ZNqwxbYGxIDL58BubGgCoeWSu977OvSs73DzW98d9Q1b1DnMXvNWhH0 hXsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SCcG7wWi; 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 h19si7203199ede.498.2021.09.13.07.05.32; Mon, 13 Sep 2021 07:05:59 -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=SCcG7wWi; 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 S245269AbhIMODR (ORCPT + 99 others); Mon, 13 Sep 2021 10:03:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:49604 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243837AbhIMOAj (ORCPT ); Mon, 13 Sep 2021 10:00:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2F326613AB; Mon, 13 Sep 2021 13:37:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631540255; bh=L5THohV6IidN9Kc/xggYUb7EwyTAIEaF9O9yKpIKOhg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SCcG7wWidPz40YwQ/uGaXeaXtL4sjOQC4/iF2fMxxg6JH9Dy92or2SSSUWOdqGSli 8IVEl/zdDDK6EjCS9+NpfcFcqO1sNxDu4eZbTOEwxZXDLh2ox8DpfxG8rp5IjaI5fz jV/95zLjO4Twl7lXuB87RNe2sqgPyDdryBcF8cQE= 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.13 117/300] Bluetooth: btusb: Fix a unspported condition to set available debug features Date: Mon, 13 Sep 2021 15:12:58 +0200 Message-Id: <20210913131113.349744024@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131109.253835823@linuxfoundation.org> References: <20210913131109.253835823@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 9122f9cc97cb..ae0cf5e71584 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -2912,10 +2912,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); @@ -3008,10 +3009,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