mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
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>
This commit is contained in:
parent
aa1ced7f09
commit
10f087f73f
1 changed files with 1 additions and 1 deletions
2
cmd/sf.c
2
cmd/sf.c
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue