Skip to content

Commit

Permalink
vfio/platform: fix module_put call in error flow
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mgurtovoy authored and awilliam committed May 24, 2021
1 parent 752774c commit dc51ff9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/vfio/platform/vfio_platform_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit dc51ff9

Please sign in to comment.