diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c index a57698985f9c4..8313f81968d51 100644 --- a/drivers/uio/uio.c +++ b/drivers/uio/uio.c @@ -1010,8 +1010,6 @@ void uio_unregister_device(struct uio_info *info) idev = info->uio_dev; - uio_free_minor(idev); - mutex_lock(&idev->info_lock); uio_dev_del_attributes(idev); @@ -1026,6 +1024,8 @@ void uio_unregister_device(struct uio_info *info) device_unregister(&idev->dev); + uio_free_minor(idev); + return; } EXPORT_SYMBOL_GPL(uio_unregister_device);