Bluetooth: mgmt: Fix double free on error path
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 26 Jul 2022 15:13:44 +0000 (18:13 +0300)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 26 Jul 2022 20:32:40 +0000 (13:32 -0700)
Don't call mgmt_pending_remove() twice (double free).

Fixes: 6b88eff43704 ("Bluetooth: hci_sync: Refactor remove Adv Monitor")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/mgmt.c

index ae758ab..2f91a8c 100644 (file)
@@ -4723,7 +4723,6 @@ static int __add_adv_patterns_monitor(struct sock *sk, struct hci_dev *hdev,
                else
                        status = MGMT_STATUS_FAILED;
 
-               mgmt_pending_remove(cmd);
                goto unlock;
        }