summaryrefslogtreecommitdiff
path: root/net/bluetooth
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2021-03-29 20:27:04 +0300
committerMarcel Holtmann <marcel@holtmann.org>2021-04-02 12:09:12 +0300
commit0ae8ef674eb391d5a832967eb03cfe06904b31d0 (patch)
treea22eaa26e06ae63249c6f11140f875ff650c98d1 /net/bluetooth
parent06752d1678b49ac471f11950ebd6d29541828bba (diff)
downloadlinux-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')
-rw-r--r--net/bluetooth/smp.c4
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;