Skip to content

Commit

Permalink
backlight: lm3630a_bl: Put fwnode in error case during ->probe()
Browse files Browse the repository at this point in the history
[ Upstream commit 6d1c32d ]

device_for_each_child_node() bumps a reference counting of a returned variable.
We have to balance it whenever we return to the caller.

Cc: Brian Masney <masneyb@onstation.org>
Cc: Dan Murphy <dmurphy@ti.com>
Fixes: 8fbce8e ("backlight: lm3630a: Add firmware node support")
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Brian Masney <masneyb@onstation.org>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
andy-shev authored and gregkh committed Jul 14, 2021
1 parent d4ebf35 commit 2e1d76c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/video/backlight/lm3630a_bl.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,10 @@ static int lm3630a_parse_node(struct lm3630a_chip *pchip,

device_for_each_child_node(pchip->dev, node) {
ret = lm3630a_parse_bank(pdata, node, &seen_led_sources);
if (ret)
if (ret) {
fwnode_handle_put(node);
return ret;
}
}

return ret;
Expand Down

0 comments on commit 2e1d76c

Please sign in to comment.