bluesleep: destroy wake lock when probe function failed
Kerwin Wan [Wed, 1 Aug 2012 04:31:16 +0000 (12:31 +0800)]
bug 1024242

Change-Id: Ifc87514d9824ae3deba3503e57421fadf995e4dc
Signed-off-by: Kerwin Wan <kerwinw@nvidia.com>
Reviewed-on: http://git-master/r/119873
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

drivers/bluetooth/bluesleep.c

index ac9caed..1089451 100644 (file)
@@ -671,11 +671,13 @@ static int bluesleep_probe(struct platform_device *pdev)
        }
        if (ret  < 0) {
                BT_ERR("Couldn't acquire BT_HOST_WAKE IRQ");
-               goto free_bt_ext_wake;
+               goto free_wake_lock;
        }
 
        return 0;
 
+free_wake_lock:
+       wake_lock_destroy(&bsi->wake_lock);
 free_bt_ext_wake:
        gpio_free(bsi->ext_wake);
 free_bt_host_wake: