From: Roman Smirnov Date: Fri, 1 Mar 2024 13:39:16 +0000 (+0000) Subject: Bluetooth: mgmt: remove NULL check in add_ext_adv_params_complete() X-Git-Tag: v6.9-rc1~159^2~36^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a310d74dce686a6ed77155b5a5e67f0e7b3619fd;p=thirdparty%2Flinux.git Bluetooth: mgmt: remove NULL check in add_ext_adv_params_complete() 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 Reviewed-by: Sergey Shtylyov Signed-off-by: Luiz Augusto von Dentz --- diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 8f16287930dc8..9613cc8a60f8b 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -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); }