summaryrefslogtreecommitdiff
path: root/net/bluetooth
diff options
context:
space:
mode:
authorRoman Smirnov <r.smirnov@omp.ru>2024-03-01 16:39:15 +0300
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2024-03-07 01:27:12 +0300
commit3237da12a388d972c15d3ed4ce07c015309709ad (patch)
treea57cffee6908a95b5d0bbda9fdc04439f27a7642 /net/bluetooth
parent1cb63d80fff6c4f501469e28a0eb6379639e0711 (diff)
downloadlinux-3237da12a388d972c15d3ed4ce07c015309709ad.tar.xz
Bluetooth: mgmt: remove NULL check in mgmt_set_connectable_complete()
Remove the cmd pointer NULL check in mgmt_set_connectable_complete() because it occurs earlier in set_connectable(). This check is also unnecessary because the pointer is dereferenced just before it. Found by Linux Verification Center (linuxtesting.org) with Svace. Signed-off-by: Roman Smirnov <r.smirnov@omp.ru> Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/mgmt.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 78ab562807d0..8f16287930dc 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -1707,8 +1707,7 @@ static void mgmt_set_connectable_complete(struct hci_dev *hdev, void *data,
new_settings(hdev, cmd->sk);
done:
- if (cmd)
- mgmt_pending_remove(cmd);
+ mgmt_pending_remove(cmd);
hci_dev_unlock(hdev);
}