From: Johan Hovold Date: Thu, 7 Jan 2016 11:28:29 +0000 (+0100) Subject: greybus: power_supply: fix lock imbalance in init error path X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e0d91ff127cf68e6369cfccd51af18b07bf462e3;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git greybus: power_supply: fix lock imbalance in init error path Make sure to release the supplies_lock before returning on errors in gb_power_supplies_setup(). Signed-off-by: Johan Hovold Reviewed-by: Rui Miguel Silva Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/power_supply.c b/drivers/staging/greybus/power_supply.c index 4a7381650bb7..1f3884bccf97 100644 --- a/drivers/staging/greybus/power_supply.c +++ b/drivers/staging/greybus/power_supply.c @@ -644,8 +644,10 @@ static int gb_power_supplies_setup(struct gb_power_supplies *supplies) sizeof(struct gb_power_supply), GFP_KERNEL); - if (!supplies->supply) - return -ENOMEM; + if (!supplies->supply) { + ret = -ENOMEM; + goto out; + } for (i = 0; i < supplies->supplies_count; i++) { ret = gb_power_supply_config(supplies, i);