From: Roman Smirnov Date: Fri, 1 Mar 2024 13:39:15 +0000 (+0000) Subject: Bluetooth: mgmt: remove NULL check in mgmt_set_connectable_complete() X-Git-Tag: microblaze-v6.10~161^2~36^2~5 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=3237da12a388d972c15d3ed4ce07c015309709ad;p=linux-2.6-microblaze.git 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 Reviewed-by: Sergey Shtylyov Signed-off-by: Luiz Augusto von Dentz --- 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); }