diff mbox series

leds: netxbig: add missing of_node_put() in netxbig_leds_get_of_pdata()

Message ID 20220428100419.543937-1-yangyingliang@huawei.com
State Superseded
Headers show
Series leds: netxbig: add missing of_node_put() in netxbig_leds_get_of_pdata() | expand

Commit Message

Yang Yingliang April 28, 2022, 10:04 a.m. UTC
Add missing of_node_put() in error path in netxbig_leds_get_of_pdata().

Fixes: 9af512e81964 ("leds: netxbig: Convert to use GPIO descriptors")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/leds/leds-netxbig.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/leds/leds-netxbig.c b/drivers/leds/leds-netxbig.c
index 77213b79f84d..6692de0af68f 100644
--- a/drivers/leds/leds-netxbig.c
+++ b/drivers/leds/leds-netxbig.c
@@ -440,6 +440,7 @@  static int netxbig_leds_get_of_pdata(struct device *dev,
 	}
 	gpio_ext_pdev = of_find_device_by_node(gpio_ext_np);
 	if (!gpio_ext_pdev) {
+		of_node_put(gpio_ext_np);
 		dev_err(dev, "Failed to find platform device for gpio-ext\n");
 		return -ENODEV;
 	}