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: <1255522550-15199-1-git-send-email-aaro.koskinen@nokia.com>
Date:	Wed, 14 Oct 2009 15:15:49 +0300
From:	Aaro Koskinen <aaro.koskinen@...ia.com>
To:	sameo@...ux.intel.com, linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] mfd: twl4030-power: do not allow negative or zero length script

The script length cannot be negative. If the length is zero, return
an error.

The patch eliminates the following compiler warning:

drivers/mfd/twl4030-power.c: In function 'twl4030_power_init':
drivers/mfd/twl4030-power.c:151: warning: 'err' may be used uninitialized in this function
drivers/mfd/twl4030-power.c:151: note: 'err' was declared here

Signed-off-by: Aaro Koskinen <aaro.koskinen@...ia.com>
---
 drivers/mfd/twl4030-power.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
index d423e0c..eae6cda 100644
--- a/drivers/mfd/twl4030-power.c
+++ b/drivers/mfd/twl4030-power.c
@@ -146,9 +146,9 @@ out:
 }
 
 static int __init twl4030_write_script(u8 address, struct twl4030_ins *script,
-				       int len)
+				       unsigned len)
 {
-	int err;
+	int err = EINVAL;
 
 	for (; len; len--, address++, script++) {
 		if (len == 1) {
-- 
1.6.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ