irda: fix read buffer overflow
Subsystems (2)
PATCH 1/1 irda: fix read buffer overflow
From: Roel Kluin <[email protected]>
io[i] is read before the bounds check on i, order should be reversed.
Signed-off-by Roel Kluin <[email protected]>
Cc Samuel Ortiz <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
drivers/net/irda/w83977af_ir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/irda/w83977af_ir.c renamed from drivers/net/irda/w83977af_ir.c~irda-fix-read-buffer-overflow +1 -1
@@ -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 ; }
_
From: [email protected]
Date: Thu, 06 Aug 2009 16:06:03 -0700
Quoted 6 lines
From: Roel Kluin <[email protected]>
io[i] is read before the bounds check on i, order should be reversed.
Signed-off-by Roel Kluin <[email protected]>Signed-off-by Andrew Morton <[email protected]>
Applied.