Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1044012pxu; Fri, 16 Oct 2020 02:19:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5NtFvsGxMZ1VpUlSzp7McWhUfWOiqe8v2EIqdooRakB2jmgLSKlEK0u722NbZ8RkLusef X-Received: by 2002:a17:906:86ce:: with SMTP id j14mr2824265ejy.158.1602839951436; Fri, 16 Oct 2020 02:19:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602839951; cv=none; d=google.com; s=arc-20160816; b=P58Oi9lZ8C5PPAKvqyNVcBS21Qvvr/4cpivicxmw0fAZW4so7ZCr7HDP4A2Kq31TOA q/IS4lKMPlWk47sF5vDsSWXrjxKrPjoo88aLwfQNUwpzipDaqflaxa/1mS9Gyiyn15e/ JUyk2V1wJDfGdQYqBlqzXzBAOVDBz7gJ1QUHOB8DVE2G6xbBQZmakeFgi47ipqZgKxGl W8QyqjaoDwz/qCBw/D9CwlKdd48wr5NTKb2kuYdrFDKZghbg6ov5oy+XDh9ChPFXHZhr PBexIOJwiXNt3Bts1NAtMfXIRv7odhQpu4O5E89jcGZvuAY0QXcImGa4pIuQL5ATOWkF XUKQ== 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=Phuj86FqRCQo86iOvSE3ERD/d+nByfHFWNohbbWzr80=; b=OEiQPb0z/5WD2qNeThh6LXEEKcJ2PzcoRLvEwXD6Bc/2yAwbsqS3mm0KbeYxYBdUaJ RX5e4FEjROna27ujRSouwFVNwMkOC0C0fPK6naMB1np3izm5I0xvb3LkrNdY0T6tbpGL 1pTIjk+kCg7Sqn1PQ7Wtj7SGsJn2ccmY8MNpLGlNubphCCrGaFzgJxiOi5AUZYGt7emr 4b9nFSpf717f0JfQ1B6Gb03y7v16rltnyT53jb4tjzSom/xml6c+paAYFyIdRT4O3uq+ UOmYslqmUjKIZnTZt2nQLZrNC3ItqjCHT6jNdvuoCY5ezdTHpWT9Rg5LFzBUZuYSt3PV Zzjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JCgD6Csz; 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=fail (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 dd2si1290139ejb.347.2020.10.16.02.18.49; Fri, 16 Oct 2020 02:19:11 -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=@kernel.org header.s=default header.b=JCgD6Csz; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406045AbgJPJQW (ORCPT + 99 others); Fri, 16 Oct 2020 05:16:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:37244 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405531AbgJPJIl (ORCPT ); Fri, 16 Oct 2020 05:08:41 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 4FAC320789; Fri, 16 Oct 2020 09:08:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602839308; bh=zCbt4TgR/cSSoDbtAoAQDZcRmZDurmgTE2G7/PcMsGM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JCgD6CszeXqdkEcLkuEAul6nKO40p3SSYWyqt1puhUJqfhr3iLHiQFEwLwwXImhxP oilwkMnOJ96Oejli1aDCK4bz1lE6j3KO0jwGhtpRC8/w1ZK8O8vfl1wqRmctPqRrDu ESdWlqrsg1RQNrvCcGwVZSlL5R19XXXfWVRoZd3w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Luiz Augusto von Dentz , Marcel Holtmann Subject: [PATCH 4.14 04/18] Bluetooth: MGMT: Fix not checking if BT_HS is enabled Date: Fri, 16 Oct 2020 11:07:14 +0200 Message-Id: <20201016090437.492139590@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201016090437.265805669@linuxfoundation.org> References: <20201016090437.265805669@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: Luiz Augusto von Dentz commit b560a208cda0297fef6ff85bbfd58a8f0a52a543 upstream. This checks if BT_HS is enabled relecting it on MGMT_SETTING_HS instead of always reporting it as supported. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann Signed-off-by: Greg Kroah-Hartman --- net/bluetooth/mgmt.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -635,7 +635,8 @@ static u32 get_supported_settings(struct if (lmp_ssp_capable(hdev)) { settings |= MGMT_SETTING_SSP; - settings |= MGMT_SETTING_HS; + if (IS_ENABLED(CONFIG_BT_HS)) + settings |= MGMT_SETTING_HS; } if (lmp_sc_capable(hdev)) @@ -1645,6 +1646,10 @@ static int set_hs(struct sock *sk, struc BT_DBG("request for %s", hdev->name); + if (!IS_ENABLED(CONFIG_BT_HS)) + return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS, + MGMT_STATUS_NOT_SUPPORTED); + status = mgmt_bredr_support(hdev); if (status) return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS, status);