u-boot/board/ti/common
Nishanth Menon 7774e97aa7 ti: common: board_detect: Return a valid empty string for un-initialized eeprom
Current logic for query of revision, board_name, config returns
NULL. Users of these functions do a direct strncmp to compare.
Unfortunately, as per conventions require two valid strings to compare
against and the current implementation causes a crash when compared
with NULL.

We'd still like to maintain the simplistic usage of these APIs instead
of redundant if (string) res=strncmp(fn(),"cmp",n); flowing all over
the place.

Hence, since the version, name and config is already pre-initialized
with empty string, just dont check for invalid header in the first
place and return the empty string to the caller.

Reported-by: Brad Griffis <bgriffis@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
[trini: Correct was'nt -> wasn't typo]
Signed-off-by: Tom Rini <trini@konsulko.com>
2016-10-31 10:12:21 -04:00
..
board_detect.c ti: common: board_detect: Return a valid empty string for un-initialized eeprom 2016-10-31 10:12:21 -04:00
board_detect.h ti: common: board_detect: Return a valid empty string for un-initialized eeprom 2016-10-31 10:12:21 -04:00
Kconfig Convert CONFIG_SPL_SERIAL_SUPPORT to Kconfig 2016-09-16 17:27:19 -04:00
Makefile ARM: omap-common: Add standard access for board description EEPROM 2016-03-14 19:18:33 -04:00