Commit dc51ff91 authored by Max Gurtovoy's avatar Max Gurtovoy Committed by Alex Williamson

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: 32a2d71c ("vfio: platform: introduce vfio-platform-base module")
Signed-off-by: default avatarMax Gurtovoy <mgurtovoy@nvidia.com>
Message-Id: <20210518192133.59195-1-mgurtovoy@nvidia.com>
Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent 752774ce
......@@ -291,7 +291,7 @@ static int vfio_platform_open(struct vfio_device *core_vdev)
vfio_platform_regions_cleanup(vdev);
err_reg:
mutex_unlock(&driver_lock);
module_put(THIS_MODULE);
module_put(vdev->parent_module);
return ret;
}
......
Markdown is supported
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