[U-Boot] [PATCH v2 4/6] status_led: Print an error when the LED id is out of range
Otavio Salvador
otavio at ossystems.com.br
Sat Sep 28 21:19:23 CEST 2013
Signed-off-by: Otavio Salvador <otavio at ossystems.com.br>
---
Changes in v2:
- new patch
drivers/misc/status_led.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/misc/status_led.c b/drivers/misc/status_led.c
index 6b71ad4..33148c9 100644
--- a/drivers/misc/status_led.c
+++ b/drivers/misc/status_led.c
@@ -94,9 +94,10 @@ void status_led_set (int led, int state)
{
led_dev_t *ld;
- if (led < 0 || led >= MAX_LED_DEV)
+ if (led < 0 || led >= MAX_LED_DEV) {
+ printf("ERROR: LED bit is out of range\n");
return;
+ }
if (!status_led_init_done)
status_led_init ();
--
1.8.4.rc3
More information about the U-Boot
mailing list