From: "Marek Behún" <kabel@kernel.org>
To: linux-leds@vger.kernel.org
Cc: "Pavel Machek" <pavel@ucw.cz>,
dmurphy@ti.com, "Marek Behún" <kabel@kernel.org>,
"kernel test robot" <lkp@intel.com>,
"Dan Carpenter" <dan.carpenter@oracle.com>
Subject: [PATCH leds] leds: tca6507: fix potential zero passed to ERR_PTR
Date: Sat, 26 Sep 2020 21:43:02 +0200 [thread overview]
Message-ID: <20200926194302.22003-1-kabel@kernel.org> (raw)
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
next reply other threads:[~2020-09-26 19:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-26 19:43 Marek Behún [this message]
2020-09-26 19:54 ` [PATCH leds] leds: tca6507: fix potential zero passed to ERR_PTR Pavel Machek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200926194302.22003-1-kabel@kernel.org \
--to=kabel@kernel.org \
--cc=dan.carpenter@oracle.com \
--cc=dmurphy@ti.com \
--cc=linux-leds@vger.kernel.org \
--cc=lkp@intel.com \
--cc=pavel@ucw.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox