diff options
author | Andy Shevchenko <andy.shevchenko@gmail.com> | 2021-05-10 12:57:16 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-07-14 17:53:40 +0300 |
commit | 77c61b1b298967ad37d1f74cc8fc0afa756ec2a5 (patch) | |
tree | c41cb40d39b965e9584f9d9c8099155cf3ae661d /drivers/video | |
parent | 57fd7d8ac921b2e58bbb4e524c238e915c7d62ae (diff) | |
download | linux-77c61b1b298967ad37d1f74cc8fc0afa756ec2a5.tar.xz |
backlight: lm3630a_bl: Put fwnode in error case during ->probe()
[ Upstream commit 6d1c32dbedd7d7e7372aa38033ec8782c39f6379 ]
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: 8fbce8efe15cd ("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>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/backlight/lm3630a_bl.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/video/backlight/lm3630a_bl.c b/drivers/video/backlight/lm3630a_bl.c index 2d8e8192e4e2..f03ffe2bb237 100644 --- a/drivers/video/backlight/lm3630a_bl.c +++ b/drivers/video/backlight/lm3630a_bl.c @@ -480,8 +480,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; |