linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] applicom: Prevent unsigned wrap in ac_interrupt()
@ 2009-08-08 15:13 Roel Kluin
  2009-08-09 20:30 ` Jiri Slaby
  0 siblings, 1 reply; 4+ messages in thread
From: Roel Kluin @ 2009-08-08 15:13 UTC (permalink / raw)
  To: Andrew Morton, LKML

unsigned i wraps if this occurs in the first iteration.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
Or do we know this can't happen?

diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c
index 73a0765..0df3e12 100644
--- a/drivers/char/applicom.c
+++ b/drivers/char/applicom.c
@@ -670,7 +670,7 @@ static irqreturn_t ac_interrupt(int vec, void *dev_instance)
 			}
 			Dummy = readb(apbs[i].RamIO + VERS);
 
-			if(readb(apbs[i].RamIO + RAM_IT_TO_PC)) {
+			if(i && readb(apbs[i].RamIO + RAM_IT_TO_PC)) {
 				/* There's another int waiting on this card */
 				spin_unlock(&apbs[i].mutex);
 				i--;

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

end of thread, other threads:[~2009-08-11 12:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-08 15:13 [PATCH] applicom: Prevent unsigned wrap in ac_interrupt() Roel Kluin
2009-08-09 20:30 ` Jiri Slaby
2009-08-11  8:54   ` roel kluin
2009-08-11  9:00     ` Jiri Slaby

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).