cosa_init: check bounds before access
Subsystems (2)
PATCH 1/1 cosa_init: check bounds before access
Check i < io bounds before accessing io[i].
Signed-off-by Gaurav Singh <[email protected]>
--- drivers/net/wan/cosa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wan/cosa.c +1 -1
@@ -363,7 +363,7 @@ static int __init cosa_init(void) }for (i=0 ; i<MAX_CARDS ; i++) cosa_cards[i].num =-1 ; -for (i=0 ; io[i] !=0 && i <MAX_CARDS ; i++) +for (i=0 ; i <MAX_CARDS && io[i] !=0 ; i++)cosa_probe (io[i], irq[i], dma[i]);if (!nr_cards) {pr_warn ("no devices found\n" );
Signature · 1 line
2.17.1
David Miller
maintainerFrom: Gaurav Singh <[email protected]>
Date: Tue, 23 Jun 2020 21:04:49 -0400
Quoted 3 lines
Check i < io bounds before accessing io[i].
Signed-off-by Gaurav Singh <[email protected]>
The io[] array is intentionally zero terminated, there is no problem.