From: Kuo-Jung Su Date: Thu, 4 Jul 2013 03:40:36 +0000 (+0800) Subject: cfi_flash: use buffer length in unmap_physmem() X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=d8b57c0a83f9cabc476ca0045c0089195c894b81;p=u-boot.git cfi_flash: use buffer length in unmap_physmem() While the flash_detect_legacy() of drivers/mtd/cfi_flash.c feed unmap_physmem() with MAP_NOCACHE as 2nd parameter, the do_spi_flash_read_write() of common/cmd_sf.c feed unmap_physmem() with the length of the mapped buffer as 2nd parameter. It's apparently a bug, and I personally think the 2nd parameter should be the length of the mapped buffer. Signed-off-by: Kuo-Jung Su CC: Albert Aribaud CC: Stefan Roese Signed-off-by: Stefan Roese --- diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index 25a5710758..616750d77e 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -1820,7 +1820,7 @@ static int flash_detect_legacy(phys_addr_t base, int banknum) break; else unmap_physmem((void *)info->start[0], - MAP_NOCACHE); + info->portwidth); } }