mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
mtd: maps: gpio-addr-flash: Fix ioremapped size
commit6c925b3333upstream. We should only iomap the area of the chip that is memory mapped. Otherwise we could be mapping devices beyond the memory space or that belong to other devices. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Fixes:ebd71e3a48("mtd: maps: gpio-addr-flash: fix warnings and make more portable") Cc: <stable@vger.kernel.org> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
6737137331
commit
53772af08a
@@ -238,7 +238,7 @@ static int gpio_flash_probe(struct platform_device *pdev)
|
||||
state->map.copy_to = gf_copy_to;
|
||||
state->map.bankwidth = pdata->width;
|
||||
state->map.size = state->win_size * (1 << state->gpio_count);
|
||||
state->map.virt = ioremap_nocache(memory->start, state->map.size);
|
||||
state->map.virt = ioremap_nocache(memory->start, state->win_size);
|
||||
if (!state->map.virt)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user