From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Tue, 26 Jul 2022 18:13:44 +0300
Subject: Bluetooth: mgmt: Fix double free on error path
Patch-mainline: v5.19
Git-commit: 4b2f4e072fb2599b6a2e5e277f0d2b5705eaa630
References: jsc#PED-1407
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>
Acked-by: Lee, Chun-Yi <jlee@suse.com>
---
net/bluetooth/mgmt.c | 1 -
1 file changed, 1 deletion(-)
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -4723,7 +4723,6 @@ static int __add_adv_patterns_monitor(st
else
status = MGMT_STATUS_FAILED;
- mgmt_pending_remove(cmd);
goto unlock;
}