Thread (7 messages) flat view 7 messages, 3 authors, 2021-12-21

Re: [kbuild] Re: [PATCH v9 1/3] bluetooth: msft: Handle MSFT Monitor Device Event

From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Date: 2021-12-21 21:56:55
Also in: lkml, netdev, oe-kbuild-all

Hi Manish,

On Thu, Dec 16, 2021 at 11:18 PM Dan Carpenter [off-list ref] wrote:
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 <redacted>
Reported-by: Dan Carpenter <redacted>

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@lists.01.org
To unsubscribe send an email to kbuild-leave@lists.01.org
Are you working on fixing the above problems?


-- 
Luiz Augusto von Dentz
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help