aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2021-03-29 10:27:04 -0700
committerMarcel Holtmann <marcel@holtmann.org>2021-04-02 11:09:12 +0200
commit0ae8ef674eb391d5a832967eb03cfe06904b31d0 (patch)
treea22eaa26e06ae63249c6f11140f875ff650c98d1 /net
parentBluetooth: Check inquiry status before sending one (diff)
downloadlinux-dev-0ae8ef674eb391d5a832967eb03cfe06904b31d0.tar.xz
linux-dev-0ae8ef674eb391d5a832967eb03cfe06904b31d0.zip
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')
-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;