* [PATCH leds] leds: tca6507: fix potential zero passed to ERR_PTR
@ 2020-09-26 19:43 Marek Behún
2020-09-26 19:54 ` Pavel Machek
0 siblings, 1 reply; 2+ messages in thread
From: Marek Behún @ 2020-09-26 19:43 UTC (permalink / raw)
To: linux-leds
Cc: Pavel Machek, dmurphy, Marek Behún, kernel test robot,
Dan Carpenter
Fix potential ERR_PTR(0).
Signed-off-by: Marek Behún <kabel@kernel.org>
Fixes: d78b10f5713d9 ("leds: tca6507: use fwnode API instead of OF")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/leds/leds-tca6507.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/leds/leds-tca6507.c b/drivers/leds/leds-tca6507.c
index 4b10ef9ae221..d589c89930fd 100644
--- a/drivers/leds/leds-tca6507.c
+++ b/drivers/leds/leds-tca6507.c
@@ -727,7 +727,7 @@ tca6507_led_dt_init(struct i2c_client *client)
ret = fwnode_property_read_u32(child, "reg", ®);
if (ret || reg >= NUM_LEDS) {
fwnode_handle_put(child);
- return ERR_PTR(ret);
+ return ERR_PTR(ret ? : -EINVAL);
}
tca_leds[reg] = led;
--
2.26.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH leds] leds: tca6507: fix potential zero passed to ERR_PTR
2020-09-26 19:43 [PATCH leds] leds: tca6507: fix potential zero passed to ERR_PTR Marek Behún
@ 2020-09-26 19:54 ` Pavel Machek
0 siblings, 0 replies; 2+ messages in thread
From: Pavel Machek @ 2020-09-26 19:54 UTC (permalink / raw)
To: Marek Behún; +Cc: linux-leds, dmurphy, kernel test robot, Dan Carpenter
[-- Attachment #1: Type: text/plain, Size: 292 bytes --]
Hi!
> Fix potential ERR_PTR(0).
Thanks, applied, and reorganized patches so that fix goes near the bad
commit.
Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-09-26 19:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-26 19:43 [PATCH leds] leds: tca6507: fix potential zero passed to ERR_PTR Marek Behún
2020-09-26 19:54 ` Pavel Machek
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.