diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2021-03-29 20:27:04 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2021-04-02 12:09:12 +0300 |
commit | 0ae8ef674eb391d5a832967eb03cfe06904b31d0 (patch) | |
tree | a22eaa26e06ae63249c6f11140f875ff650c98d1 /net/bluetooth/smp.c | |
parent | 06752d1678b49ac471f11950ebd6d29541828bba (diff) | |
download | linux-0ae8ef674eb391d5a832967eb03cfe06904b31d0.tar.xz |
Bluetooth: SMP: Fix variable dereferenced before check 'conn'
This fixes kbuild findings:
smatch warnings:
net/bluetooth/smp.c:1633 smp_user_confirm_reply() warn: variable
dereferenced before check 'conn' (see line 1631)
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/smp.c')
-rw-r--r-- | net/bluetooth/smp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index 2def90668173..5c17acfb1645 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c @@ -1628,11 +1628,11 @@ int smp_user_confirm_reply(struct hci_conn *hcon, u16 mgmt_op, __le32 passkey) u32 value; int err; - bt_dev_dbg(conn->hcon->hdev, ""); - if (!conn) return -ENOTCONN; + bt_dev_dbg(conn->hcon->hdev, ""); + chan = conn->smp; if (!chan) return -ENOTCONN; |