diff mbox series

[5.12,650/700] leds: as3645a: Fix error return code in as3645a_parse_node()

Message ID 20210712061045.016392079@linuxfoundation.org
State Superseded
Headers show
Series None | expand

Commit Message

Greg KH July 12, 2021, 6:12 a.m. UTC
From: Zhen Lei <thunder.leizhen@huawei.com>


[ Upstream commit 96a30960a2c5246c8ffebe8a3c9031f9df094d97 ]

Return error code -ENODEV rather than '0' when the indicator node can not
be found.

Fixes: a56ba8fbcb55 ("media: leds: as3645a: Add LED flash class driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>

Signed-off-by: Pavel Machek <pavel@ucw.cz>

Signed-off-by: Sasha Levin <sashal@kernel.org>

---
 drivers/leds/leds-as3645a.c | 1 +
 1 file changed, 1 insertion(+)

-- 
2.30.2
diff mbox series

Patch

diff --git a/drivers/leds/leds-as3645a.c b/drivers/leds/leds-as3645a.c
index e8922fa03379..80411d41e802 100644
--- a/drivers/leds/leds-as3645a.c
+++ b/drivers/leds/leds-as3645a.c
@@ -545,6 +545,7 @@  static int as3645a_parse_node(struct as3645a *flash,
 	if (!flash->indicator_node) {
 		dev_warn(&flash->client->dev,
 			 "can't find indicator node\n");
+		rval = -ENODEV;
 		goto out_err;
 	}