lkml.org 
[lkml]   [2006]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[2.6 patch] net/core/net-sysfs.c: fix an off-by-21-or-49 error
This patch fixes an off-by-21-or-49 error ;-) spotted by the Coverity 
checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

--- 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]);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-04-04 21:10    [W:0.031 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site