From 98dfd1ca5cc9b36f19f58b8cb664a553fc5c1f8a Mon Sep 17 00:00:00 2001 From: Parav Pandit Date: Fri, 24 May 2019 10:59:41 +0800 Subject: [PATCH] vfio/mdev: Follow correct remove sequence mainline inclusion from mainline-5.2-rc1 commit a6d6f4f160f7 category: bugfix bugzilla: 15885 CVE: NA ------------------------------------------------- mdev_remove_sysfs_files() should follow exact mirror sequence of a create, similar to what is followed in error unwinding path of mdev_create_sysfs_files(). Fixes: 6a62c1dfb5c7 ("vfio/mdev: Re-order sysfs attribute creation") Reviewed-by: Cornelia Huck Reviewed-by: Maxim Levitsky Signed-off-by: Parav Pandit Signed-off-by: Alex Williamson Signed-off-by: Yang Yingliang Reviewed-by: Xuefeng Wang Signed-off-by: Yang Yingliang --- drivers/vfio/mdev/mdev_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vfio/mdev/mdev_sysfs.c b/drivers/vfio/mdev/mdev_sysfs.c index 249472f05509..e7770b511d03 100644 --- a/drivers/vfio/mdev/mdev_sysfs.c +++ b/drivers/vfio/mdev/mdev_sysfs.c @@ -280,7 +280,7 @@ int mdev_create_sysfs_files(struct device *dev, struct mdev_type *type) void mdev_remove_sysfs_files(struct device *dev, struct mdev_type *type) { + sysfs_remove_files(&dev->kobj, mdev_device_attrs); sysfs_remove_link(&dev->kobj, "mdev_type"); sysfs_remove_link(type->devices_kobj, dev_name(dev)); - sysfs_remove_files(&dev->kobj, mdev_device_attrs); } -- GitLab