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: <20070206210557.2948f56d.khali@linux-fr.org>
Date:	Tue, 6 Feb 2007 21:05:57 +0100
From:	Jean Delvare <khali@...ux-fr.org>
To:	Greg Kroah-Hartman <gregkh@...e.de>
Cc:	LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH]Fix warning in device_add_attrs

Fix the following warning which I see with gcc 3.2:
drivers/base/core.c: In function `device_add_attrs':
drivers/base/core.c:251: warning: `i' might be used uninitialized in this function
It's a false positive, but it can be worked around easily, and the new
code makes rather more sense.

Signed-off-by: Jean Delvare <khali@...ux-fr.org>
---
 drivers/base/core.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- linux-2.6.20.orig/drivers/base/core.c	2007-02-06 09:25:49.000000000 +0100
+++ linux-2.6.20/drivers/base/core.c	2007-02-06 20:40:46.000000000 +0100
@@ -259,10 +259,10 @@ static int device_add_attrs(struct devic
 			if (error)
 				break;
 		}
+		if (error)
+			while (--i >= 0)
+				device_remove_file(dev, &class->dev_attrs[i]);
 	}
-	if (error)
-		while (--i >= 0)
-			device_remove_file(dev, &class->dev_attrs[i]);
 	return error;
 }
 


-- 
Jean Delvare
-
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