netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Joseph Hwang <josephsih@chromium.org>,
	linux-bluetooth@vger.kernel.org, marcel@holtmann.org,
	luiz.dentz@gmail.com, pali@kernel.org
Cc: lkp@intel.com, kbuild-all@lists.01.org,
	chromeos-bluetooth-upstreaming@chromium.org,
	josephsih@google.com, Joseph Hwang <josephsih@chromium.org>,
	Jakub Kicinski <kuba@kernel.org>,
	Johan Hedberg <johan.hedberg@gmail.com>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH v4 3/3] Bluetooth: mgmt: add set_quality_report for MGMT_OP_SET_QUALITY_REPORT
Date: Thu, 17 Feb 2022 17:38:33 +0300	[thread overview]
Message-ID: <202202160942.cEiT1MKh-lkp@intel.com> (raw)
In-Reply-To: <20220215133546.2826837-1-josephsih@chromium.org>

Hi Joseph,

url:    https://github.com/0day-ci/linux/commits/Joseph-Hwang/Bluetooth-aosp-surface-AOSP-quality-report-through-mgmt/20220215-213800
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
config: i386-randconfig-m021-20220214 (https://download.01.org/0day-ci/archive/20220216/202202160942.cEiT1MKh-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
net/bluetooth/mgmt.c:860 get_supported_settings() warn: variable dereferenced before check 'hdev' (see line 826)

vim +/hdev +860 net/bluetooth/mgmt.c

69ab39ea5da03e Johan Hedberg          2011-12-15  816  static u32 get_supported_settings(struct hci_dev *hdev)
69ab39ea5da03e Johan Hedberg          2011-12-15  817  {
69ab39ea5da03e Johan Hedberg          2011-12-15  818  	u32 settings = 0;
69ab39ea5da03e Johan Hedberg          2011-12-15  819  
69ab39ea5da03e Johan Hedberg          2011-12-15  820  	settings |= MGMT_SETTING_POWERED;
b2939475eb6a35 Johan Hedberg          2014-07-30  821  	settings |= MGMT_SETTING_BONDABLE;
b1de97d8c06d9d Marcel Holtmann        2014-01-31  822  	settings |= MGMT_SETTING_DEBUG_KEYS;
3742abfc4e853f Johan Hedberg          2014-07-08  823  	settings |= MGMT_SETTING_CONNECTABLE;
3742abfc4e853f Johan Hedberg          2014-07-08  824  	settings |= MGMT_SETTING_DISCOVERABLE;
69ab39ea5da03e Johan Hedberg          2011-12-15  825  
ed3fa31f35896b Andre Guedes           2012-07-24 @826  	if (lmp_bredr_capable(hdev)) {
1a47aee85f8a08 Johan Hedberg          2013-03-15  827  		if (hdev->hci_ver >= BLUETOOTH_VER_1_2)
33c525c0a37abd Johan Hedberg          2012-10-24  828  			settings |= MGMT_SETTING_FAST_CONNECTABLE;
69ab39ea5da03e Johan Hedberg          2011-12-15  829  		settings |= MGMT_SETTING_BREDR;
69ab39ea5da03e Johan Hedberg          2011-12-15  830  		settings |= MGMT_SETTING_LINK_SECURITY;
a82974c9f4ed07 Marcel Holtmann        2013-10-11  831  
a82974c9f4ed07 Marcel Holtmann        2013-10-11  832  		if (lmp_ssp_capable(hdev)) {
a82974c9f4ed07 Marcel Holtmann        2013-10-11  833  			settings |= MGMT_SETTING_SSP;
b560a208cda029 Luiz Augusto von Dentz 2020-08-06  834  			if (IS_ENABLED(CONFIG_BT_HS))
d7b7e79688c07b Marcel Holtmann        2012-02-20  835  				settings |= MGMT_SETTING_HS;
848566b381e72b Marcel Holtmann        2013-10-01  836  		}
e98d2ce293a941 Marcel Holtmann        2014-01-10  837  
05b3c3e7905d00 Marcel Holtmann        2014-12-31  838  		if (lmp_sc_capable(hdev))
e98d2ce293a941 Marcel Holtmann        2014-01-10  839  			settings |= MGMT_SETTING_SECURE_CONN;
4b127bd5f2cc1b Alain Michaud          2020-02-27  840  
00bce3fb0642b3 Alain Michaud          2020-03-05  841  		if (test_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED,
4b127bd5f2cc1b Alain Michaud          2020-02-27  842  			     &hdev->quirks))
00bce3fb0642b3 Alain Michaud          2020-03-05  843  			settings |= MGMT_SETTING_WIDEBAND_SPEECH;
a82974c9f4ed07 Marcel Holtmann        2013-10-11  844  	}
d7b7e79688c07b Marcel Holtmann        2012-02-20  845  
eeca6f891305a8 Johan Hedberg          2013-09-25  846  	if (lmp_le_capable(hdev)) {
69ab39ea5da03e Johan Hedberg          2011-12-15  847  		settings |= MGMT_SETTING_LE;
a3209694f82a22 Johan Hedberg          2014-05-26  848  		settings |= MGMT_SETTING_SECURE_CONN;
0f4bd942f13dd1 Johan Hedberg          2014-02-22  849  		settings |= MGMT_SETTING_PRIVACY;
93690c227acf08 Marcel Holtmann        2015-03-06  850  		settings |= MGMT_SETTING_STATIC_ADDRESS;
cbbdfa6f331980 Sathish Narasimman     2020-07-23  851  		settings |= MGMT_SETTING_ADVERTISING;
eeca6f891305a8 Johan Hedberg          2013-09-25  852  	}
69ab39ea5da03e Johan Hedberg          2011-12-15  853  
eb1904f49d3e11 Marcel Holtmann        2014-07-04  854  	if (test_bit(HCI_QUIRK_EXTERNAL_CONFIG, &hdev->quirks) ||

Unchecked dereferences throughout.

eb1904f49d3e11 Marcel Holtmann        2014-07-04  855  	    hdev->set_bdaddr)
9fc3bfb681bdf5 Marcel Holtmann        2014-07-04  856  		settings |= MGMT_SETTING_CONFIGURATION;
9fc3bfb681bdf5 Marcel Holtmann        2014-07-04  857  
6244691fec4dd0 Jaganath Kanakkassery  2018-07-19  858  	settings |= MGMT_SETTING_PHY_CONFIGURATION;
6244691fec4dd0 Jaganath Kanakkassery  2018-07-19  859  
edbb68b1006482 Joseph Hwang           2022-02-15 @860  	if (hdev && (aosp_has_quality_report(hdev) ||
                                                            ^^^^
Checked too late

edbb68b1006482 Joseph Hwang           2022-02-15  861  		     hdev->set_quality_report))
edbb68b1006482 Joseph Hwang           2022-02-15  862  		settings |= MGMT_SETTING_QUALITY_REPORT;
edbb68b1006482 Joseph Hwang           2022-02-15  863  
69ab39ea5da03e Johan Hedberg          2011-12-15  864  	return settings;
69ab39ea5da03e Johan Hedberg          2011-12-15  865  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org


  parent reply	other threads:[~2022-02-17 14:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-15 13:35 [PATCH v4 1/3] Bluetooth: aosp: surface AOSP quality report through mgmt Joseph Hwang
2022-02-15 13:35 ` [PATCH v4 2/3] Bluetooth: btintel: surface Intel telemetry events " Joseph Hwang
2022-02-17 12:53   ` Marcel Holtmann
2022-03-05  7:46     ` Joseph Hwang
2022-02-15 13:35 ` [PATCH v4 3/3] Bluetooth: mgmt: add set_quality_report for MGMT_OP_SET_QUALITY_REPORT Joseph Hwang
2022-02-17 13:04   ` Marcel Holtmann
2022-03-05  7:51     ` Joseph Hwang
2022-02-17 14:38   ` Dan Carpenter [this message]
2022-02-15 17:52 ` [PATCH v4 1/3] Bluetooth: aosp: surface AOSP quality report through mgmt kernel test robot
2022-02-17 12:41 ` Marcel Holtmann
2022-03-05  7:42   ` Joseph Hwang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202202160942.cEiT1MKh-lkp@intel.com \
    --to=dan.carpenter@oracle.com \
    --cc=chromeos-bluetooth-upstreaming@chromium.org \
    --cc=johan.hedberg@gmail.com \
    --cc=josephsih@chromium.org \
    --cc=josephsih@google.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=kuba@kernel.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    --cc=netdev@vger.kernel.org \
    --cc=pali@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).