i2400m: keep index within ms_to_errno[]
authorRoel Kluin <roel.kluin@gmail.com>
Sun, 12 Jul 2009 23:48:42 +0000 (01:48 +0200)
committerInaky Perez-Gonzalez <inaky@linux.intel.com>
Mon, 19 Oct 2009 06:55:35 +0000 (15:55 +0900)
Ensure that index `status' remains within ms_to_errno[]

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
drivers/net/wimax/i2400m/control.c

index 07308686dbcf69f8fd9a90a2c05cef8641d5d9cf..8fe70e75d030f414cfdf690b63cff6f9453d9395 100644 (file)
@@ -263,7 +263,7 @@ int i2400m_msg_check_status(const struct i2400m_l3l4_hdr *l3l4_hdr,
 
        if (status == 0)
                return 0;
-       if (status > ARRAY_SIZE(ms_to_errno)) {
+       if (status >= ARRAY_SIZE(ms_to_errno)) {
                str = "unknown status code";
                result = -EBADR;
        } else {