kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] vfio/platform: fix module_put call in error flow
@ 2021-05-18 19:21 Max Gurtovoy
  2021-05-18 19:21 ` [PATCH 2/3] vfio: centralize module refcount in subsystem layer Max Gurtovoy
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Max Gurtovoy @ 2021-05-18 19:21 UTC (permalink / raw)
  To: jgg, cohuck, kvm, alex.williamson; +Cc: oren, eric.auger, Max Gurtovoy

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: 32a2d71c4e808 ("vfio: platform: introduce vfio-platform-base module")

Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
---
 drivers/vfio/platform/vfio_platform_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/vfio/platform/vfio_platform_common.c b/drivers/vfio/platform/vfio_platform_common.c
index 361e5b57e369..470fcf7dac56 100644
--- a/drivers/vfio/platform/vfio_platform_common.c
+++ b/drivers/vfio/platform/vfio_platform_common.c
@@ -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;
 }
 
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-05-26 17:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 19:21 [PATCH 1/3] vfio/platform: fix module_put call in error flow Max Gurtovoy
2021-05-18 19:21 ` [PATCH 2/3] vfio: centralize module refcount in subsystem layer Max Gurtovoy
2021-05-26 17:42   ` Auger Eric
2021-05-18 19:21 ` [PATCH 3/3] vfio/platform: remove unneeded parent_module attribute Max Gurtovoy
2021-05-26 17:41   ` Auger Eric
2021-05-24 19:34 ` [PATCH 1/3] vfio/platform: fix module_put call in error flow Alex Williamson
2021-05-26  9:34   ` Max Gurtovoy
2021-05-26 17:27 ` Auger Eric

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).