Bluetooth: mgmt: remove NULL check in add_ext_adv_params_complete()
authorRoman Smirnov <r.smirnov@omp.ru>
Fri, 1 Mar 2024 13:39:16 +0000 (13:39 +0000)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 6 Mar 2024 22:27:13 +0000 (17:27 -0500)
Remove the cmd pointer NULL check in add_ext_adv_params_complete()
because it occurs earlier in add_ext_adv_params(). 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>
net/bluetooth/mgmt.c

index 8f16287930dc82a6c06ed348d0fbb187e8ca466a..9613cc8a60f8bbf9a3060714baaf8d60bed05015 100644 (file)
@@ -8767,8 +8767,7 @@ static void add_ext_adv_params_complete(struct hci_dev *hdev, void *data,
        }
 
 unlock:
-       if (cmd)
-               mgmt_pending_free(cmd);
+       mgmt_pending_free(cmd);
 
        hci_dev_unlock(hdev);
 }