pinctrl: microchip-sgpio: Put fwnode in error case during ->probe()
Subsystems (3)
PATCH 1/1 pinctrl: microchip-sgpio: 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 7e5ea974e61c ("pinctrl: pinctrl-microchip-sgpio: Add pinctrl driver for Microsemi Serial GPIO")
Cc Lars Povlsen <[email protected]>
Signed-off-by Andy Shevchenko <[email protected]>
--- drivers/pinctrl/pinctrl-microchip-sgpio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/pinctrl/pinctrl-microchip-sgpio.c +3 -1
@@ -845,8 +845,10 @@ static int microchip_sgpio_probe(struct platform_device *pdev) i =0 ;device_for_each_child_node (dev, fwnode) { ret =microchip_sgpio_register_bank (dev, priv, fwnode, i++); -if (ret) +if (ret) { +fwnode_handle_put (fwnode);return ret; + } }if (priv->in.gpio.ngpio != priv->out.gpio.ngpio) {
Signature · 1 line
2.31.1
Sun, Jun 06, 2021 at 10:19:40PM +0300, Andy Shevchenko kirjoitti:
Quoted 2 lines
device_for_each_child_node()bumps a reference counting of a returned variable. We have to balance it whenever we return to the caller.
Linus, any comments on this? Can it be applied sooner than later since it's a fix?
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 6 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 7e5ea974e61c ("pinctrl: pinctrl-microchip-sgpio: Add pinctrl driver for Microsemi Serial GPIO")Cc Lars Povlsen <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>
Patch applied for fixes, I got a bit snowed under because of patch-spot activity.
Yours,
Linus Walleij