iommufd/selftest: Don't leak the platform device memory when unloading the module
authorYang Yingliang <yangyingliang@huawei.com>
Wed, 16 Aug 2023 08:13:18 +0000 (16:13 +0800)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 18 Aug 2023 15:56:24 +0000 (12:56 -0300)
commiteb501c2d96cfce6b42528e8321ea085ec605e790
treee2229a8d39574ac9078d957a9196b13da04471fc
parent55243393b06ced5378dcdbb7d51bd8a8edc69294
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: 23a1b46f15d5 ("iommufd/selftest: Make the mock iommu driver into a real driver")
Link: https://lore.kernel.org/r/20230816081318.1232865-1-yangyingliang@huawei.com
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/iommu/iommufd/selftest.c