mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 14:04:54 +02:00
power: supply: Fix refcount leak in rk817_charger_probe
[ Upstream commit54c03bfd09] of_get_child_by_name() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes:11cb8da018("power: supply: Add charger driver for Rockchip RK817") Signed-off-by: Qiheng Lin <linqiheng@huawei.com> Reviewed-by: Chris Morgan <macromorgan@hotmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
b866e8a0b7
commit
7d1e396172
|
|
@ -1060,8 +1060,10 @@ static int rk817_charger_probe(struct platform_device *pdev)
|
|||
return -ENODEV;
|
||||
|
||||
charger = devm_kzalloc(&pdev->dev, sizeof(*charger), GFP_KERNEL);
|
||||
if (!charger)
|
||||
if (!charger) {
|
||||
of_node_put(node);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
charger->rk808 = rk808;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user