[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <0fc79fe9-da49-4cbe-a7ff-6443ad93f120@web.de>
Date: Tue, 4 Jun 2024 17:15:37 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: kernel-janitors@...r.kernel.org, Andy Shevchenko <andy@...nel.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>, Marek Behún
<kabel@...nel.org>, Miguel Ojeda <ojeda@...nel.org>,
Robin van der Gracht <robin@...tonic.nl>
Cc: LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] auxdisplay: ht16k33: Drop device node reference after
registration failure in ht16k33_led_probe()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Tue, 4 Jun 2024 17:02:15 +0200
A failed call of the function “devm_led_classdev_register_ext”
can be reported.
Add a call of the function “fwnode_handle_put” for this error case.
Fixes: c223d9c636ed ("auxdisplay: ht16k33: Add LED support")
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/auxdisplay/ht16k33.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/auxdisplay/ht16k33.c b/drivers/auxdisplay/ht16k33.c
index ce987944662c..ef86537c9d83 100644
--- a/drivers/auxdisplay/ht16k33.c
+++ b/drivers/auxdisplay/ht16k33.c
@@ -483,8 +483,10 @@ static int ht16k33_led_probe(struct device *dev, struct led_classdev *led,
led->max_brightness = MAX_BRIGHTNESS;
err = devm_led_classdev_register_ext(dev, led, &init_data);
- if (err)
+ if (err) {
dev_err(dev, "Failed to register LED\n");
+ fwnode_handle_put(init_data.fwnode);
+ }
return err;
}
--
2.45.1
Powered by blists - more mailing lists