Skip to content

Commit

Permalink
irda: fix read buffer overflow
Browse files Browse the repository at this point in the history
io[i] is read before the bounds check on i, order should be reversed.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Samuel Ortiz <samuel@sortiz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Roel Kluin authored and David S. Miller committed Aug 10, 2009
1 parent cb2f33e commit 5d5ceb8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/irda/w83977af_ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ static int __init w83977af_init(void)

IRDA_DEBUG(0, "%s()\n", __func__ );

for (i=0; (io[i] < 2000) && (i < ARRAY_SIZE(dev_self)); i++) {
for (i=0; i < ARRAY_SIZE(dev_self) && io[i] < 2000; i++) {
if (w83977af_open(i, io[i], irq[i], dma[i]) == 0)
return 0;
}
Expand Down

0 comments on commit 5d5ceb8

Please sign in to comment.