]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
vfio/mdev: Follow correct remove sequence
authorParav Pandit <parav@mellanox.com>
Tue, 30 Apr 2019 22:49:32 +0000 (17:49 -0500)
committerAlex Williamson <alex.williamson@redhat.com>
Tue, 7 May 2019 17:23:13 +0000 (11:23 -0600)
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 <cohuck@redhat.com>
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/mdev/mdev_sysfs.c

index 5193a0e0ce5aa4d2fb97ea57957eeb99b53b45be..cbf94b8165ea8a78c77cbd45515b3945a250fcb8 100644 (file)
@@ -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);
 }