linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [2.6 patch] net/core/net-sysfs.c: fix an off-by-21-or-49 error
@ 2006-04-04 19:07 Adrian Bunk
  2006-04-06  5:19 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Adrian Bunk @ 2006-04-04 19:07 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel

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]);


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [2.6 patch] net/core/net-sysfs.c: fix an off-by-21-or-49 error
  2006-04-04 19:07 [2.6 patch] net/core/net-sysfs.c: fix an off-by-21-or-49 error Adrian Bunk
@ 2006-04-06  5:19 ` David S. Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2006-04-06  5:19 UTC (permalink / raw)
  To: bunk; +Cc: netdev, linux-kernel

From: Adrian Bunk <bunk@stusta.de>
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 <bunk@stusta.de>

Applied, thanks Adrian.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-04-06  5:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-04 19:07 [2.6 patch] net/core/net-sysfs.c: fix an off-by-21-or-49 error Adrian Bunk
2006-04-06  5:19 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).