diff options
author | Liam Beguin <liambeguin@gmail.com> | 2018-03-14 19:15:11 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-03-22 13:25:20 -0400 |
commit | 10f087f73fff024c81439b50423ba69589d5c161 (patch) | |
tree | 372de402e327e40b1d304b5b797d06e1a8e9627f /cmd | |
parent | aa1ced7f09798700f3d96f39f6f5dc7d3d34cf66 (diff) | |
download | u-boot-10f087f73fff024c81439b50423ba69589d5c161.tar.gz u-boot-10f087f73fff024c81439b50423ba69589d5c161.tar.bz2 u-boot-10f087f73fff024c81439b50423ba69589d5c161.zip |
cmd: sf: fix map_physmem check
Make sure 0x00 is a valid address to read to. If `addr` is 0x00 then
map_physmem() will return 0 which should be a valid address.
Signed-off-by: Liam Beguin <liambeguin@gmail.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/sf.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -287,7 +287,7 @@ static int do_spi_flash_read_write(int argc, char * const argv[]) } buf = map_physmem(addr, len, MAP_WRBACK); - if (!buf) { + if (!buf && addr) { puts("Failed to map physical memory\n"); return 1; } |