diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-08-06 17:06:03 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-10 08:45:30 +0400 |
commit | 5d5ceb8bdde403529ad9849f300dc80b1884550f (patch) | |
tree | 81420b05ee4a9055300e66e65c08df81b3a3edb1 /drivers/net/irda | |
parent | cb2f33e9596632979c140c243ac1e8e994f62180 (diff) | |
download | linux-5d5ceb8bdde403529ad9849f300dc80b1884550f.tar.xz |
irda: fix read buffer overflow
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>
Diffstat (limited to 'drivers/net/irda')
-rw-r--r-- | drivers/net/irda/w83977af_ir.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/irda/w83977af_ir.c b/drivers/net/irda/w83977af_ir.c index d0883835b0c6..fe4f2b2bff96 100644 --- a/drivers/net/irda/w83977af_ir.c +++ b/drivers/net/irda/w83977af_ir.c @@ -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; } |