Skip to content
Commit 1b4bb2ea authored by James Morse's avatar James Morse Committed by Alex Williamson
Browse files

vfio/platform: store mapped memory in region, instead of an on-stack copy

vfio_platform_{read,write}_mmio() call ioremap_nocache() to map
a region of io memory, which they store in struct vfio_platform_region to
be eventually re-used, or unmapped by vfio_platform_regions_cleanup().

These functions receive a copy of their struct vfio_platform_region
argument on the stack - so these mapped areas are always allocated, and
always leaked.

Pass this argument as a pointer instead.

Fixes: 6e3f2645

 "vfio/platform: read and write support for the device fd"
Signed-off-by: default avatarJames Morse <james.morse@arm.com>
Acked-by: default avatarBaptiste Reynal <b.reynal@virtualopensystems.com>
Tested-by: default avatarBaptiste Reynal <b.reynal@virtualopensystems.com>
Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent 4644321f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment