Commit e0d91ff1 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

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: default avatarJohan Hovold <johan@hovoldconsulting.com>
Reviewed-by: default avatarRui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent a463fc15
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment