[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250727075649.34496-1-len.bao@gmx.us>
Date: Sun, 27 Jul 2025 07:56:45 +0000
From: Len Bao <len.bao@....us>
To: Chanwoo Choi <cw00.choi@...sung.com>,
Krzysztof Kozlowski <krzk@...nel.org>,
Lee Jones <lee@...nel.org>,
Pavel Machek <pavel@...nel.org>
Cc: linux-kernel@...r.kernel.org,
linux-leds@...r.kernel.org,
Len Bao <len.bao@....us>
Subject: [PATCH] leds: max77705: Function return instead of variable assignment
Coverity noticed that assigning value -EINVAL to 'ret' in the if
statement is useless because 'ret' is overwritten a few lines later.
However, afer inspect the code, this warning reveals that we need to
return -EIVANL instead of the variable assignment. So, fix it.
Coverity-id: 1646104
Fixes: aebb5fc9a0d8 ("leds: max77705: Add LEDs support")
Signed-off-by: Len Bao <len.bao@....us>
---
drivers/leds/leds-max77705.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/leds/leds-max77705.c b/drivers/leds/leds-max77705.c
index 933cb4f19..b7403b3fc 100644
--- a/drivers/leds/leds-max77705.c
+++ b/drivers/leds/leds-max77705.c
@@ -180,7 +180,7 @@ static int max77705_add_led(struct device *dev, struct regmap *regmap, struct fw
ret = fwnode_property_read_u32(np, "reg", ®);
if (ret || reg >= MAX77705_LED_NUM_LEDS)
- ret = -EINVAL;
+ return -EINVAL;
info = devm_kcalloc(dev, num_channels, sizeof(*info), GFP_KERNEL);
if (!info)
--
2.43.0
Powered by blists - more mailing lists