tree:
https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.10
head: a14daa5347bacafd6b416560b38bc48a3e80cc67
commit: ad25b27bf35f7dcf7f3c87bfc7852599e6242111 [98/107] UPSTREAM: Bluetooth: SMP:
Convert BT_ERR/BT_DBG to bt_dev_err/bt_dev_dbg
config: h8300-randconfig-m031-20210618 (attached as .config)
compiler: h8300-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
net/bluetooth/smp.c:1634 smp_user_confirm_reply() warn: variable dereferenced before check
'conn' (see line 1632)
vim +/conn +1634 net/bluetooth/smp.c
2b64d153a0cc9d Brian Gix 2011-12-21 1624 int smp_user_confirm_reply(struct
hci_conn *hcon, u16 mgmt_op, __le32 passkey)
2b64d153a0cc9d Brian Gix 2011-12-21 1625 {
b10e8017bd9d02 Johan Hedberg 2014-06-27 1626 struct l2cap_conn *conn =
hcon->l2cap_data;
5d88cc73dded31 Johan Hedberg 2014-08-08 1627 struct l2cap_chan *chan;
2b64d153a0cc9d Brian Gix 2011-12-21 1628 struct smp_chan *smp;
2b64d153a0cc9d Brian Gix 2011-12-21 1629 u32 value;
fc75cc8684d21d Johan Hedberg 2014-09-05 1630 int err;
2b64d153a0cc9d Brian Gix 2011-12-21 1631
ad25b27bf35f7d Luiz Augusto von Dentz 2021-03-15 @1632
bt_dev_dbg(conn->hcon->hdev, "");
^^^^^^^^^^^^^^^^
Dereference
2b64d153a0cc9d Brian Gix 2011-12-21 1633
fc75cc8684d21d Johan Hedberg 2014-09-05 @1634 if (!conn)
^^^^^
Checked too late.
2b64d153a0cc9d Brian Gix 2011-12-21 1635 return -ENOTCONN;
2b64d153a0cc9d Brian Gix 2011-12-21 1636
5d88cc73dded31 Johan Hedberg 2014-08-08 1637 chan = conn->smp;
5d88cc73dded31 Johan Hedberg 2014-08-08 1638 if (!chan)
5d88cc73dded31 Johan Hedberg 2014-08-08 1639 return -ENOTCONN;
5d88cc73dded31 Johan Hedberg 2014-08-08 1640
fc75cc8684d21d Johan Hedberg 2014-09-05 1641 l2cap_chan_lock(chan);
fc75cc8684d21d Johan Hedberg 2014-09-05 1642 if (!chan->data) {
fc75cc8684d21d Johan Hedberg 2014-09-05 1643 err = -ENOTCONN;
fc75cc8684d21d Johan Hedberg 2014-09-05 1644 goto unlock;
fc75cc8684d21d Johan Hedberg 2014-09-05 1645 }
fc75cc8684d21d Johan Hedberg 2014-09-05 1646
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org