vfio/mdev: Avoid masking error code to EBUSY
authorParav Pandit <parav@mellanox.com>
Tue, 30 Apr 2019 22:49:31 +0000 (17:49 -0500)
committerAlex Williamson <alex.williamson@redhat.com>
Tue, 7 May 2019 17:23:13 +0000 (11:23 -0600)
Instead of masking return error to -EBUSY, return actual error
returned by the driver.

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_core.c

index 00ca613..836d319 100644 (file)
@@ -141,7 +141,7 @@ static int mdev_device_remove_ops(struct mdev_device *mdev, bool force_remove)
         */
        ret = parent->ops->remove(mdev);
        if (ret && !force_remove)
-               return -EBUSY;
+               return ret;
 
        sysfs_remove_groups(&mdev->dev.kobj, parent->ops->mdev_attr_groups);
        return 0;