mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 12:11:40 +00:00
power: supply: max1720x: fix a double free on error in probe()
In this code, if devm_add_action_or_reset() fails, it will call
max1720x_unregister_ancillary() which in turn calls
i2c_unregister_device(). Thus the call to i2c_unregister_device() on the
following line is not required and is a double unregister. Delete it.
Fixes: 47271a9356
("power: supply: max1720x: add read support for nvmem")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/9c2f76e7-5679-473b-9b9c-e11b492b96ac@stanley.mountain
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
parent
6625767049
commit
48f703d6a3
@ -427,7 +427,6 @@ static int max1720x_probe_nvmem(struct i2c_client *client,
|
||||
|
||||
ret = devm_add_action_or_reset(dev, max1720x_unregister_ancillary, info);
|
||||
if (ret) {
|
||||
i2c_unregister_device(info->ancillary);
|
||||
dev_err(dev, "Failed to add unregister callback\n");
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user