public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] rtc: at91sam9: fix OF node leak in probe() error path
@ 2024-08-25 18:31 Krzysztof Kozlowski
  2024-08-25 19:35 ` Markus Elfring
  2024-09-11 22:30 ` [PATCH] " Alexandre Belloni
  0 siblings, 2 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2024-08-25 18:31 UTC (permalink / raw)
  To: Alexandre Belloni, Nicolas Ferre, Claudiu Beznea, Boris Brezillon,
	Johan Hovold, Arnd Bergmann, linux-rtc, linux-arm-kernel,
	linux-kernel
  Cc: Krzysztof Kozlowski, stable

Driver is leaking an OF node reference obtained from
of_parse_phandle_with_fixed_args().

Fixes: 43e112bb3dea ("rtc: at91sam9: make use of syscon/regmap to access GPBR registers")
Cc: <stable@vger.kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/rtc/rtc-at91sam9.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c
index f93bee96e362..993c0878fb66 100644
--- a/drivers/rtc/rtc-at91sam9.c
+++ b/drivers/rtc/rtc-at91sam9.c
@@ -368,6 +368,7 @@ static int at91_rtc_probe(struct platform_device *pdev)
 		return ret;
 
 	rtc->gpbr = syscon_node_to_regmap(args.np);
+	of_node_put(args.np);
 	rtc->gpbr_offset = args.args[0];
 	if (IS_ERR(rtc->gpbr)) {
 		dev_err(&pdev->dev, "failed to retrieve gpbr regmap, aborting.\n");
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-09-11 22:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-25 18:31 [PATCH] rtc: at91sam9: fix OF node leak in probe() error path Krzysztof Kozlowski
2024-08-25 19:35 ` Markus Elfring
2024-08-26  6:59   ` Krzysztof Kozlowski
2024-08-26  7:12     ` Markus Elfring
2024-08-26  7:30       ` Greg KH
2024-09-11 22:30 ` [PATCH] " Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox