leds: tca6507: fix potential zero passed to ERR_PTR
PATCH 1/1 leds: tca6507: fix potential zero passed to ERR_PTR
Fix potential ERR_PTR(0).
Signed-off-by Marek Behún <[email protected]>
Fixes d78b10f5713d9 ("leds: tca6507: use fwnode API instead of OF")
Reported-by kernel test robot <[email protected]>
Reported-by Dan Carpenter <[email protected]>
--- drivers/leds/leds-tca6507.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/leds/leds-tca6507.c +1 -1
@@ -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;
Signature · 1 line
2.26.2
Pavel Machek
AppliedHi!
Quoted 1 line
Fix potential
ERR_PTR(0).
Thanks, applied, and reorganized patches so that fix goes near the bad commit.
Best regards,
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html