Common : Fix ectool led cmd segmentation fault

led_color_names[] should have EC_LED_COLOR_COUNT numbers of data.

A missing data cause strcasecmp() compare argv[] with NULL in
find_led_color_by_name(), that results in Bundle Image test error

BUG=chrome-os-partner:50612
BRANCH=lars
TEST=`make -j buildall`, `ectool led power blue=255` with homemade ectool.
Signed-off-by: Ryan Zhang <Ryan.Zhang@quantatw.com>

Change-Id: I2132775f9d4a074517f9a98b81919dd77bc86102
Reviewed-on: https://chromium-review.googlesource.com/330075
Commit-Ready: David Wu <david_wu@quantatw.com>
Tested-by: Ryan Zhang <Ryan.Zhang@quantatw.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
This commit is contained in:
Ryan Zhang
2016-03-03 11:10:31 +08:00
committed by chrome-bot
parent 28334368a8
commit 9d472018f9

View File

@@ -222,7 +222,7 @@ static const char * const image_names[] = {"unknown", "RO", "RW"};
/* Note: depends on enum ec_led_colors */
static const char * const led_color_names[EC_LED_COLOR_COUNT] = {
"red", "green", "blue", "yellow", "white"};
"red", "green", "blue", "yellow", "white", "amber"};
/* Note: depends on enum ec_led_id */
static const char * const led_names[EC_LED_ID_COUNT] = {