MIPS: Fix read buffer overflow
authorRoel Kluin <roel.kluin@gmail.com>
Wed, 29 Jul 2009 20:02:53 +0000 (22:02 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Mon, 3 Aug 2009 16:52:45 +0000 (17:52 +0100)
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/ar7/prom.c

index a320bceb2f9dbf9d08ad0ddc396ad4bb037df683..5ad6f1db65677b17f41082f6b38895eb19d43e46 100644 (file)
@@ -144,7 +144,7 @@ static char * __init lookup_psp_var_map(u8 num)
 {
        int i;
 
-       for (i = 0; i < sizeof(psp_var_map); i++)
+       for (i = 0; i < ARRAY_SIZE(psp_var_map); i++)
                if (psp_var_map[i].num == num)
                        return psp_var_map[i].value;