All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] vfio/ap_ops: Add missed vfio_uninit_group_dev()
@ 2021-09-10 23:06 Jason Gunthorpe
  2021-09-16 18:51 ` Alex Williamson
  0 siblings, 1 reply; 5+ messages in thread
From: Jason Gunthorpe @ 2021-09-10 23:06 UTC (permalink / raw)
  To: Christian Borntraeger, Harald Freudenberger, Vasily Gorbik,
	Heiko Carstens, Jason Herne, linux-s390, Halil Pasic
  Cc: Tony Krowiak, Alex Williamson, Cornelia Huck, Christoph Hellwig, kvm

Without this call an xarray entry is leaked when the vfio_ap device is
unprobed. It was missed when the below patch was rebased across the
dev_set patch.

Fixes: eb0feefd4c02 ("vfio/ap_ops: Convert to use vfio_register_group_dev()")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
---
 drivers/s390/crypto/vfio_ap_ops.c | 2 ++
 1 file changed, 2 insertions(+)

v2: Fix corrupted diff
v1: https://lore.kernel.org/all/0-v1-3a05c6000668+2ce62-ap_uninit_jgg@nvidia.com/

diff --git a/drivers/s390/crypto/vfio_ap_ops.c b/drivers/s390/crypto/vfio_ap_ops.c
index 2347808fa3e427..54bb0c22e8020e 100644
--- a/drivers/s390/crypto/vfio_ap_ops.c
+++ b/drivers/s390/crypto/vfio_ap_ops.c
@@ -360,6 +360,7 @@ static int vfio_ap_mdev_probe(struct mdev_device *mdev)
 	mutex_lock(&matrix_dev->lock);
 	list_del(&matrix_mdev->node);
 	mutex_unlock(&matrix_dev->lock);
+	vfio_uninit_group_dev(&matrix_mdev->vdev);
 	kfree(matrix_mdev);
 err_dec_available:
 	atomic_inc(&matrix_dev->available_instances);
@@ -375,6 +376,7 @@ static void vfio_ap_mdev_remove(struct mdev_device *mdev)
 	mutex_lock(&matrix_dev->lock);
 	vfio_ap_mdev_reset_queues(matrix_mdev);
 	list_del(&matrix_mdev->node);
+	vfio_uninit_group_dev(&matrix_mdev->vdev);
 	kfree(matrix_mdev);
 	atomic_inc(&matrix_dev->available_instances);
 	mutex_unlock(&matrix_dev->lock);

base-commit: ea870730d83fc13a5fa2bd0e175176d7ac8a400a
-- 
2.33.0


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

end of thread, other threads:[~2021-09-21  0:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-10 23:06 [PATCH v2] vfio/ap_ops: Add missed vfio_uninit_group_dev() Jason Gunthorpe
2021-09-16 18:51 ` Alex Williamson
2021-09-20 21:26   ` Tony Krowiak
2021-09-20 23:19     ` Jason Gunthorpe
2021-09-21  0:40       ` Tony Krowiak

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.