Skip to content

Commit

Permalink
Bluetooth: SMP: Fix variable dereferenced before check 'conn'
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
  • Loading branch information
Vudentz authored and holtmann committed Apr 2, 2021
1 parent 06752d1 commit 0ae8ef6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/bluetooth/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0ae8ef6

Please sign in to comment.