lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202112171439.KaggScQN-lkp@intel.com>
Date:   Fri, 17 Dec 2021 10:17:18 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     kbuild@...ts.01.org, Manish Mandlik <mmandlik@...gle.com>,
        marcel@...tmann.org, luiz.dentz@...il.com
Cc:     lkp@...el.com, kbuild-all@...ts.01.org,
        chromeos-bluetooth-upstreaming@...omium.org,
        linux-bluetooth@...r.kernel.org,
        Manish Mandlik <mmandlik@...gle.com>,
        Miao-chen Chou <mcchou@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Johan Hedberg <johan.hedberg@...il.com>,
        linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Subject: [kbuild] Re: [PATCH v9 1/3] bluetooth: msft: Handle MSFT Monitor
 Device Event

Hi Manish,

url:    https://github.com/0day-ci/linux/commits/Manish-Mandlik/bluetooth-msft-Handle-MSFT-Monitor-Device-Event/20211216-205227 
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git  master
config: i386-randconfig-m021-20211216 (https://download.01.org/0day-ci/archive/20211217/202112171439.KaggScQN-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@...el.com>
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>

smatch warnings:
net/bluetooth/msft.c:757 msft_vendor_evt() warn: inconsistent returns '&hdev->lock'.

vim +757 net/bluetooth/msft.c

3e54c5890c87a30 Luiz Augusto von Dentz 2021-12-01  714  void msft_vendor_evt(struct hci_dev *hdev, void *data, struct sk_buff *skb)
145373cb1b1fcdb Miao-chen Chou         2020-04-03  715  {
145373cb1b1fcdb Miao-chen Chou         2020-04-03  716  	struct msft_data *msft = hdev->msft_data;
e5af6a85decc8c1 Manish Mandlik         2021-12-16  717  	u8 *evt_prefix;
e5af6a85decc8c1 Manish Mandlik         2021-12-16  718  	u8 *evt;
145373cb1b1fcdb Miao-chen Chou         2020-04-03  719  
145373cb1b1fcdb Miao-chen Chou         2020-04-03  720  	if (!msft)
145373cb1b1fcdb Miao-chen Chou         2020-04-03  721  		return;
145373cb1b1fcdb Miao-chen Chou         2020-04-03  722  
145373cb1b1fcdb Miao-chen Chou         2020-04-03  723  	/* When the extension has defined an event prefix, check that it
145373cb1b1fcdb Miao-chen Chou         2020-04-03  724  	 * matches, and otherwise just return.
145373cb1b1fcdb Miao-chen Chou         2020-04-03  725  	 */
145373cb1b1fcdb Miao-chen Chou         2020-04-03  726  	if (msft->evt_prefix_len > 0) {
e5af6a85decc8c1 Manish Mandlik         2021-12-16  727  		evt_prefix = msft_skb_pull(hdev, skb, 0, msft->evt_prefix_len);
e5af6a85decc8c1 Manish Mandlik         2021-12-16  728  		if (!evt_prefix)
145373cb1b1fcdb Miao-chen Chou         2020-04-03  729  			return;
145373cb1b1fcdb Miao-chen Chou         2020-04-03  730  
e5af6a85decc8c1 Manish Mandlik         2021-12-16  731  		if (memcmp(evt_prefix, msft->evt_prefix, msft->evt_prefix_len))
145373cb1b1fcdb Miao-chen Chou         2020-04-03  732  			return;
145373cb1b1fcdb Miao-chen Chou         2020-04-03  733  	}
145373cb1b1fcdb Miao-chen Chou         2020-04-03  734  
145373cb1b1fcdb Miao-chen Chou         2020-04-03  735  	/* Every event starts at least with an event code and the rest of
145373cb1b1fcdb Miao-chen Chou         2020-04-03  736  	 * the data is variable and depends on the event code.
145373cb1b1fcdb Miao-chen Chou         2020-04-03  737  	 */
145373cb1b1fcdb Miao-chen Chou         2020-04-03  738  	if (skb->len < 1)
145373cb1b1fcdb Miao-chen Chou         2020-04-03  739  		return;
145373cb1b1fcdb Miao-chen Chou         2020-04-03  740  
e5af6a85decc8c1 Manish Mandlik         2021-12-16  741  	hci_dev_lock(hdev);
145373cb1b1fcdb Miao-chen Chou         2020-04-03  742  
e5af6a85decc8c1 Manish Mandlik         2021-12-16  743  	evt = msft_skb_pull(hdev, skb, 0, sizeof(*evt));
e5af6a85decc8c1 Manish Mandlik         2021-12-16  744  	if (!evt)
e5af6a85decc8c1 Manish Mandlik         2021-12-16  745  		return;

Missing hci_dev_unlock(hdev);

e5af6a85decc8c1 Manish Mandlik         2021-12-16  746  
e5af6a85decc8c1 Manish Mandlik         2021-12-16  747  	switch (*evt) {
e5af6a85decc8c1 Manish Mandlik         2021-12-16  748  	case MSFT_EV_LE_MONITOR_DEVICE:
e5af6a85decc8c1 Manish Mandlik         2021-12-16  749  		msft_monitor_device_evt(hdev, skb);
e5af6a85decc8c1 Manish Mandlik         2021-12-16  750  		break;
e5af6a85decc8c1 Manish Mandlik         2021-12-16  751  
e5af6a85decc8c1 Manish Mandlik         2021-12-16  752  	default:
e5af6a85decc8c1 Manish Mandlik         2021-12-16  753  		bt_dev_dbg(hdev, "MSFT vendor event 0x%02x", *evt);
e5af6a85decc8c1 Manish Mandlik         2021-12-16  754  		break;
e5af6a85decc8c1 Manish Mandlik         2021-12-16  755  	}
e5af6a85decc8c1 Manish Mandlik         2021-12-16  756  
e5af6a85decc8c1 Manish Mandlik         2021-12-16 @757  	hci_dev_unlock(hdev);
145373cb1b1fcdb Miao-chen Chou         2020-04-03  758  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org 
_______________________________________________
kbuild mailing list -- kbuild@...ts.01.org
To unsubscribe send an email to kbuild-leave@...ts.01.org

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ