Subject: [2.6 patch] net/core/net-sysfs.c: fix an off-by-21-or-49 error

From: Adrian Bunk <[email-masked]>
Date: Tue, 4 Apr 2006 21:07:42 +0200

This patch fixes an off-by-21-or-49 error ;-) spotted by the Coverity 
checker.

Signed-off-by: Adrian Bunk <[email-masked]>

--- linux-2.6.17-rc1-mm1-full/net/core/net-sysfs.c.old	2006-04-04 20:36:32.000000000 +0200
+++ linux-2.6.17-rc1-mm1-full/net/core/net-sysfs.c	2006-04-04 20:36:49.000000000 +0200
@@ -165,7 +165,7 @@ static ssize_t show_operstate(struct cla
 		operstate = IF_OPER_DOWN;
 	read_unlock(&dev_base_lock);
 
-	if (operstate >= sizeof(operstates))
+	if (operstate >= ARRAY_SIZE(operstates))
 		return -EINVAL; /* should not happen */
 
 	return sprintf(buf, "%s\n", operstates[operstate]);