From: Dan Carpenter Date: Tue, 26 Jul 2022 15:13:44 +0000 (+0300) Subject: Bluetooth: mgmt: Fix double free on error path X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4b2f4e072fb2599b6a2e5e277f0d2b5705eaa630;p=linux.git Bluetooth: mgmt: Fix double free on error path Don't call mgmt_pending_remove() twice (double free). Fixes: 6b88eff43704 ("Bluetooth: hci_sync: Refactor remove Adv Monitor") Signed-off-by: Dan Carpenter Signed-off-by: Luiz Augusto von Dentz --- diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index ae758ab1b558d..2f91a8c2b6780 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -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; }