From a238098251b690b7408f26d7c5b4c6ba44d7084c Mon Sep 17 00:00:00 2001 From: Marek BehĂșn Date: Sat, 26 Sep 2020 21:43:02 +0200 Subject: leds: tca6507: fix potential zero passed to ERR_PTR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix potential ERR_PTR(0). Signed-off-by: Marek BehĂșn Fixes: d78b10f5713d9 ("leds: tca6507: use fwnode API instead of OF") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Pavel Machek --- drivers/leds/leds-tca6507.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/leds') 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; -- cgit v1.2.3