u-boot/board/ti
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
..
am43xx treewide: replace #include <asm/errno.h> with <linux/errno.h> 2016-09-23 17:55:42 -04:00
am57xx board: am57xx: Fix missing check for beagle_x15 2016-09-07 08:49:05 -04:00
am335x board: am335x: Always set eth/eth1addr environment variable 2016-10-13 12:25:10 -05:00
am3517crane omap-common: Common function to display die id, replacing omap3-specific version 2015-10-22 14:18:30 -04:00
beagle treewide: replace #include <asm/errno.h> with <linux/errno.h> 2016-09-23 17:55:42 -04:00
common ti: common: board_detect: Return a valid empty string for un-initialized eeprom 2016-10-31 10:12:21 -04:00
dra7xx board: ti: dra7xx: complex definitions should be protected with parentheses 2016-10-08 09:33:35 -04:00
evm omap3: Drop omap3_evm_quick_* targets 2016-08-05 20:53:53 -04:00
ks2_evm board: ks2: Enable ECC using detected DDR size 2016-10-01 20:05:05 -04:00
omap5_uevm arch, board: squash lines for immediate return 2016-09-23 17:53:53 -04:00
panda omap-common: Rename set_muxconf_regs_essential to set_muxconf_regs 2016-03-15 15:12:06 -04:00
sdp4430 omap-common: Rename set_muxconf_regs_essential to set_muxconf_regs 2016-03-15 15:12:06 -04:00
ti814x ti814x_evm: Switch to SYS_GENERIC_BOARD 2015-09-15 13:55:22 -04:00
ti816x ti816x: Switch to SYS_GENERIC_BOARD 2015-09-15 13:55:23 -04:00