Searched hist:"7774 e97aa77c1fc18283a1ee1bfb9bdf7c6a14f2" (Results 1 – 2 of 2) sorted by relevance
| /rk3399_rockchip-uboot/board/ti/common/ |
| H A D | board_detect.h | 7774e97aa77c1fc18283a1ee1bfb9bdf7c6a14f2 Tue Oct 11 17:39:05 UTC 2016 Nishanth Menon <nm@ti.com> 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>
|
| H A D | board_detect.c | 7774e97aa77c1fc18283a1ee1bfb9bdf7c6a14f2 Tue Oct 11 17:39:05 UTC 2016 Nishanth Menon <nm@ti.com> 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>
|