mirror of
https://github.com/OpenAMP/libmetal.git
synced 2026-09-21 08:53:47 +08:00
linux: device: unmap regions for linux device
This unmaps the device regions which were opened during metal_uio_dev_open. Failure to do this results in a file descriptor leak. Signed-off-by: Lane Kolbly <lane.kolbly@ni.com>
This commit is contained in:
committed by
Arnaud Pouliquen
parent
31dfaa172b
commit
4faa1c9d36
@@ -266,7 +266,12 @@ static void metal_uio_dev_close(struct linux_bus *lbus,
|
||||
struct linux_device *ldev)
|
||||
{
|
||||
(void)lbus;
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < ldev->device.num_regions; i++) {
|
||||
metal_unmap(ldev->device.regions[i].virt,
|
||||
ldev->device.regions[i].size);
|
||||
}
|
||||
if (ldev->override) {
|
||||
sysfs_write_attribute(ldev->override, "", 1);
|
||||
ldev->override = NULL;
|
||||
|
||||
Reference in New Issue
Block a user