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>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211218152712.2832502-1-trix@redhat.com>
Date:   Sat, 18 Dec 2021 07:27:12 -0800
From:   trix@...hat.com
To:     linus.walleij@...aro.org, brgl@...ev.pl, nathan@...nel.org,
        ndesaulniers@...gle.com
Cc:     linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
        llvm@...ts.linux.dev, Tom Rix <trix@...hat.com>
Subject: [PATCH] gpio: sim: fix uninitialized ret variable

From: Tom Rix <trix@...hat.com>

Building with clang returns this error:

gpio-sim.c:889:7: error: variable 'ret' is uninitialized
  when used here

ret should be the status of the call to
gpio_sim_make_bank_swnode stored in bank->swnode.

Fixes: 83960fcf4818 ("gpio: sim: new testing module")
Signed-off-by: Tom Rix <trix@...hat.com>
---
 drivers/gpio/gpio-sim.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-sim.c b/drivers/gpio/gpio-sim.c
index ef6145f51c8ae..bef00dcc4dc8f 100644
--- a/drivers/gpio/gpio-sim.c
+++ b/drivers/gpio/gpio-sim.c
@@ -886,7 +886,8 @@ static int gpio_sim_device_activate_unlocked(struct gpio_sim_device *dev)
 
 	list_for_each_entry(bank, &dev->bank_list, siblings) {
 		bank->swnode = gpio_sim_make_bank_swnode(bank, swnode);
-		if (ret) {
+		if (IS_ERR(bank->swnode)) {
+			ret = PTR_ERR(bank->swnode);
 			gpio_sim_remove_swnode_recursive(swnode);
 			return ret;
 		}
-- 
2.26.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ