Skip to contentSkip to conversation

leds: tca6507: fix potential zero passed to ERR_PTR

PATCH Applied Marek Behún 2 participants 2 messages Sep 26, 2020 LED

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 leds: tca6507: fix potential zero passed to ERR_PTR

Fix potential ERR_PTR(0).

Fixes d78b10f5713d9 ("leds: tca6507: use fwnode API instead of OF")
---
 drivers/leds/leds-tca6507.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/leds/leds-tca6507.c +1 -1
index 4b10ef9ae221..d589c89930fd 100644
@@ -727,7 +727,7 @@ tca6507_led_dt_init(struct i2c_client *client)
 		ret = fwnode_property_read_u32(child, "reg", &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
Applied
#1 lore raw

Hi!

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