lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20221119022217.2474222-1-dzm91@hust.edu.cn>
Date:   Sat, 19 Nov 2022 10:22:16 +0800
From:   Dongliang Mu <dzm91@...t.edu.cn>
To:     Pavel Machek <pavel@....cz>
Cc:     Dongliang Mu <dzm91@...t.edu.cn>, linux-leds@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH] leds: leds-lp5521/3: fix uninitialized variable ret

Smatch reports the following uninitialized symbols:

drivers/leds/leds-lp5521.c:368 lp5521_multicolor_brightness()
error: uninitialized symbol 'ret'.
drivers/leds/leds-lp5523.c:811 lp5523_multicolor_brightness()
error: uninitialized symbol 'ret'.

Fix these issues by initializing ret with zero value.

Signed-off-by: Dongliang Mu <dzm91@...t.edu.cn>
---
 drivers/leds/leds-lp5521.c | 2 +-
 drivers/leds/leds-lp5523.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c
index 7ff20c260504..cef46a8b4cab 100644
--- a/drivers/leds/leds-lp5521.c
+++ b/drivers/leds/leds-lp5521.c
@@ -352,7 +352,7 @@ static int lp5521_run_selftest(struct lp55xx_chip *chip, char *buf)
 static int lp5521_multicolor_brightness(struct lp55xx_led *led)
 {
 	struct lp55xx_chip *chip = led->chip;
-	int ret;
+	int ret = 0;
 	int i;
 
 	mutex_lock(&chip->lock);
diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c
index 369d40b0b65b..e0387639946e 100644
--- a/drivers/leds/leds-lp5523.c
+++ b/drivers/leds/leds-lp5523.c
@@ -795,7 +795,7 @@ static ssize_t store_master_fader_leds(struct device *dev,
 static int lp5523_multicolor_brightness(struct lp55xx_led *led)
 {
 	struct lp55xx_chip *chip = led->chip;
-	int ret;
+	int ret = 0;
 	int i;
 
 	mutex_lock(&chip->lock);
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ