netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tokenring: Read buffer overflow
@ 2009-07-25 22:38 Roel Kluin
  2009-07-27  2:01 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-07-25 22:38 UTC (permalink / raw)
  To: David S. Miller, netdev, Andrew Morton

io[i] is read before the bounds check on i, order should be reversed

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c
index 9d89611..08a6c41 100644
--- a/drivers/net/tokenring/ibmtr.c
+++ b/drivers/net/tokenring/ibmtr.c
@@ -1912,7 +1912,7 @@ static int __init ibmtr_init(void)
 
 	find_turbo_adapters(io);
 
-	for (i = 0; io[i] && (i < IBMTR_MAX_ADAPTERS); i++) {
+	for (i = 0; i < IBMTR_MAX_ADAPTERS && io[i]; i++) {
 		struct net_device *dev;
 		irq[i] = 0;
 		mem[i] = 0;

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

end of thread, other threads:[~2009-07-27  2:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-25 22:38 [PATCH] tokenring: Read buffer overflow Roel Kluin
2009-07-27  2:01 ` David 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).