Thread (82 messages) 82 messages, 8 authors, 2021-03-23

Re: [PATCH v2 04/14] vfio/platform: Use vfio_init/register/unregister_group_dev

From: Jason Gunthorpe <jgg@nvidia.com>
Date: 2021-03-16 21:46:28

On Tue, Mar 16, 2021 at 03:33:55PM -0600, Alex Williamson wrote:
quoted
 static int vfio_platform_remove(struct platform_device *pdev)
 {
-	struct vfio_platform_device *vdev;
-
-	vdev = vfio_platform_remove_common(&pdev->dev);
-	if (vdev) {
-		kfree(vdev);
-		return 0;
-	}
+	struct vfio_platform_device *vdev = dev_get_drvdata(&pdev->dev);
 
-	return -EINVAL;
+	vfio_platform_remove_common(vdev);
+	kfree(vdev->name);

We don't own that to free it, _probe set this via:

        vdev->name = pdev->name;
Gah, yes, this is a copy&pasto mistake from the amba code

Thanks,
Jason
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help