backlight: lm3630a_bl: Put fwnode in error case during ->probe()
Subsystems (2)
PATCH 1/1 backlight: lm3630a_bl: Put fwnode in error case during ->probe()
device_for_each_child_node() bumps a reference counting of a returned variable. We have to balance it whenever we return to the caller.
Fixes 8fbce8efe15cd ("backlight: lm3630a: Add firmware node support")
Cc Brian Masney <[email protected]>
Cc Dan Murphy <[email protected]>
Signed-off-by Andy Shevchenko <[email protected]>
--- drivers/video/backlight/lm3630a_bl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/video/backlight/lm3630a_bl.c +3 -1
@@ -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;
Signature · 1 line
2.31.1
Quoted 7 lines · Andy Shevchenko
device_for_each_child_node()bumps a reference counting of a returned variable. We have to balance it whenever we return to the caller.Fixes 8fbce8efe15cd ("backlight: lm3630a: Add firmware node support")Cc Brian Masney <[email protected]>Cc Dan Murphy <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>
Reviewed-by Brian Masney <[email protected]>
Quoted 7 lines · Andy Shevchenko
device_for_each_child_node()bumps a reference counting of a returned variable. We have to balance it whenever we return to the caller.Fixes 8fbce8efe15cd ("backlight: lm3630a: Add firmware node support")Cc Brian Masney <[email protected]>Cc Dan Murphy <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>
Reviewed-by Daniel Thompson <[email protected]>
Quoted 23 lines
--- drivers/video/backlight/lm3630a_bl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/video/backlight/lm3630a_bl.c +3
-1@@ -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;Signature · 1 line
2.31.1
Lee Jones
AppliedQuoted 10 lines · Andy Shevchenko
device_for_each_child_node()bumps a reference counting of a returned variable. We have to balance it whenever we return to the caller.Fixes 8fbce8efe15cd ("backlight: lm3630a: Add firmware node support")Cc Brian Masney <[email protected]>Cc Dan Murphy <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>--- drivers/video/backlight/lm3630a_bl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Applied, thanks.
Signature · 4 lines
Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog