summaryrefslogtreecommitdiff
path: root/drivers/leds
diff options
context:
space:
mode:
authorMarek BehĂșn <kabel@kernel.org>2020-09-26 22:43:02 +0300
committerPavel Machek <pavel@ucw.cz>2020-09-30 19:53:27 +0300
commita238098251b690b7408f26d7c5b4c6ba44d7084c (patch)
tree4aba715a61594ddc4e9e665c7b4f25e672bdee4b /drivers/leds
parente8b7dabc6565d9bf74e66312cf7b8b87450c7caa (diff)
downloadlinux-a238098251b690b7408f26d7c5b4c6ba44d7084c.tar.xz
leds: tca6507: fix potential zero passed to ERR_PTR
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> Signed-off-by: Pavel Machek <pavel@ucw.cz>
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/leds-tca6507.c2
1 files changed, 1 insertions, 1 deletions
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", &reg);
if (ret || reg >= NUM_LEDS) {
fwnode_handle_put(child);
- return ERR_PTR(ret);
+ return ERR_PTR(ret ? : -EINVAL);
}
tca_leds[reg] = led;