Skip to content

Commit dc51ff9

Browse files
mgurtovoyawilliam
authored andcommitted
vfio/platform: fix module_put call in error flow
The ->parent_module is the one that use in try_module_get. It should also be the one the we use in module_put during vfio_platform_open(). Fixes: 32a2d71 ("vfio: platform: introduce vfio-platform-base module") Signed-off-by: Max Gurtovoy <[email protected]> Message-Id: <[email protected]> Signed-off-by: Alex Williamson <[email protected]>
1 parent 752774c commit dc51ff9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/vfio/platform/vfio_platform_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ static int vfio_platform_open(struct vfio_device *core_vdev)
291291
vfio_platform_regions_cleanup(vdev);
292292
err_reg:
293293
mutex_unlock(&driver_lock);
294-
module_put(THIS_MODULE);
294+
module_put(vdev->parent_module);
295295
return ret;
296296
}
297297

0 commit comments

Comments
 (0)