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]
Date:	Mon, 4 Apr 2016 14:16:57 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	Corey Minyard <minyard@....org>
Cc:	openipmi-developer@...ts.sourceforge.net,
	linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [patch] ipmi_ssif: silence an uninitialized variable warning

My static checker complains that "ret" could be zero here.  (Presumably
that means the hardware is badly busted).  But the result would be that
the caller assumes *resp_len is initialized when it's not and it leads
to a warning.  Let's just silence the warning.

Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>

diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c
index 8b3be8b..512c5b6 100644
--- a/drivers/char/ipmi/ipmi_ssif.c
+++ b/drivers/char/ipmi/ipmi_ssif.c
@@ -1232,6 +1232,8 @@ static int do_cmd(struct i2c_client *client, int len, unsigned char *msg,
 			break;
 	}
 
+	if (ret == 0)
+		ret = -EINVAL;
 	if (ret > 0) {
 		/* Validate that the response is correct. */
 		if (ret < 3 ||

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ