Commit 73580e2e authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Alexandre Belloni

rtc: at91sam9: fix OF node leak in probe() error path

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

Fixes: 43e112bb ("rtc: at91sam9: make use of syscon/regmap to access GPBR registers")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240825183103.102904-1-krzysztof.kozlowski@linaro.orgSigned-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 80bf13c0
...@@ -368,6 +368,7 @@ static int at91_rtc_probe(struct platform_device *pdev) ...@@ -368,6 +368,7 @@ static int at91_rtc_probe(struct platform_device *pdev)
return ret; return ret;
rtc->gpbr = syscon_node_to_regmap(args.np); rtc->gpbr = syscon_node_to_regmap(args.np);
of_node_put(args.np);
rtc->gpbr_offset = args.args[0]; rtc->gpbr_offset = args.args[0];
if (IS_ERR(rtc->gpbr)) { if (IS_ERR(rtc->gpbr)) {
dev_err(&pdev->dev, "failed to retrieve gpbr regmap, aborting.\n"); dev_err(&pdev->dev, "failed to retrieve gpbr regmap, aborting.\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment