The mode_val[] array has NETXBIG_LED_MODE_NUM (5) elements so the ">"
here should be ">=".

Signed-off-by: Dan Carpenter <[email protected]>

diff --git a/drivers/leds/leds-netxbig.c b/drivers/leds/leds-netxbig.c
index 028686f2..d0b743c 100644
--- a/drivers/leds/leds-netxbig.c
+++ b/drivers/leds/leds-netxbig.c
@@ -512,7 +512,7 @@ static int netxbig_leds_get_of_pdata(struct device *dev,
                                                   "mode-val", 2 * i, &mode);
                        of_property_read_u32_index(child,
                                                   "mode-val", 2 * i + 1, &val);
-                       if (mode > NETXBIG_LED_MODE_NUM)
+                       if (mode >= NETXBIG_LED_MODE_NUM)
                                return -EINVAL;
                        mode_val[mode] = val;
                }
--
To unsubscribe from this list: send the line "unsubscribe linux-leds" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to