Skip to content

Commit dc51ff9

Browse files
mgurtovoyAlex Williamson
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 <mgurtovoy@nvidia.com> Message-Id: <20210518192133.59195-1-mgurtovoy@nvidia.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
1 parent 752774c commit dc51ff9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎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)