diff options
author | Zhang Qilong <zhangqilong3@huawei.com> | 2022-11-21 02:18:31 +0100 |
---|---|---|
committer | Sebastian Reichel <sebastian.reichel@collabora.com> | 2022-11-24 22:46:06 +0100 |
commit | 955bee204f3dd307642c101b75e370662987e735 (patch) | |
tree | 93f862f409204f0dd720599b8027a7842984e463 /drivers/power/supply/samsung-sdi-battery.h | |
parent | power: supply: z2_battery: Convert to i2c's .probe_new() (diff) | |
download | linux-955bee204f3dd307642c101b75e370662987e735.tar.xz linux-955bee204f3dd307642c101b75e370662987e735.zip |
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: a3b4388ea19b ("power: supply: z2_battery: Convert to GPIO descriptors")
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power/supply/samsung-sdi-battery.h')
0 files changed, 0 insertions, 0 deletions