Skip to content

Commit eb501c2

Browse files
Yang Yingliangjgunthorpe
authored andcommitted
iommufd/selftest: Don't leak the platform device memory when unloading the module
It should call platform_device_unregister() instead of platform_device_del() to unregister and free the device. Fixes: 23a1b46 ("iommufd/selftest: Make the mock iommu driver into a real driver") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Yang Yingliang <[email protected]> Reviewed-by: Kevin Tian <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 5524339 commit eb501c2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/iommu/iommufd/selftest.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,7 @@ int __init iommufd_test_init(void)
10891089
err_bus:
10901090
bus_unregister(&iommufd_mock_bus_type.bus);
10911091
err_platform:
1092-
platform_device_del(selftest_iommu_dev);
1092+
platform_device_unregister(selftest_iommu_dev);
10931093
err_dbgfs:
10941094
debugfs_remove_recursive(dbgfs_root);
10951095
return rc;
@@ -1102,6 +1102,6 @@ void iommufd_test_exit(void)
11021102
&iommufd_mock_bus_type.bus,
11031103
&iommufd_mock_bus_type.nb);
11041104
bus_unregister(&iommufd_mock_bus_type.bus);
1105-
platform_device_del(selftest_iommu_dev);
1105+
platform_device_unregister(selftest_iommu_dev);
11061106
debugfs_remove_recursive(dbgfs_root);
11071107
}

0 commit comments

Comments
 (0)