Skip to content
Commit 955bee20 authored by Zhang Qilong's avatar Zhang Qilong Committed by Sebastian Reichel
Browse files

power: supply: z2_battery: Fix possible memleak in z2_batt_probe()



If devm_gpiod_get_optional() returns error, the charger should be
freed before z2_batt_probe returns according to the context. We
fix it by just gotoing to 'err' branch.

Fixes: a3b4388e ("power: supply: z2_battery: Convert to GPIO descriptors")
Signed-off-by: default avatarZhang Qilong <zhangqilong3@huawei.com>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 922bde5a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment