misc: bluedroid_pm: Free proc on failure

If the call to wakeup_source_register() fails during probe, then the
'proc' interface is not freed. Ensure that this is freed as expected.

JIRA LINQPJ14-60

Change-Id: I188be2998429c1ada6ccdf765791367e61735359
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3397251
(cherry picked from commit a0f0bebe2a2a54b87f91b1812c22bbd14470a61c)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3461888
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Jon Hunter
2025-07-01 13:01:21 +01:00
committed by mobile promotions
parent 7c70fbf0cf
commit 432f3748e0

View File

@@ -472,7 +472,7 @@ static int bluedroid_pm_probe(struct platform_device *pdev)
dev_name(&pdev->dev)); dev_name(&pdev->dev));
if (!bluedroid_pm->wake_lock) { if (!bluedroid_pm->wake_lock) {
BDP_ERR("Failed to register wakeup source"); BDP_ERR("Failed to register wakeup source");
goto free_ext_wake; goto free_bt_proc;
} }
/* Initialize timer */ /* Initialize timer */
@@ -489,6 +489,8 @@ static int bluedroid_pm_probe(struct platform_device *pdev)
return 0; return 0;
free_bt_proc:
remove_bt_proc_interface();
free_ext_wake: free_ext_wake:
if (bluedroid_pm->host_wake_irq > -1) if (bluedroid_pm->host_wake_irq > -1)
free_irq(bluedroid_pm->host_wake_irq, bluedroid_pm); free_irq(bluedroid_pm->host_wake_irq, bluedroid_pm);