These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / uio / uio.c
index 65bf067..bcc1fc0 100644 (file)
@@ -524,6 +524,7 @@ static ssize_t uio_read(struct file *filep, char __user *buf,
 
                event_count = atomic_read(&idev->event);
                if (event_count != listener->event_count) {
+                       __set_current_state(TASK_RUNNING);
                        if (copy_to_user(buf, &event_count, count))
                                retval = -EFAULT;
                        else {
@@ -879,7 +880,8 @@ void uio_unregister_device(struct uio_info *info)
 
        uio_dev_del_attributes(idev);
 
-       free_irq(idev->info->irq, idev);
+       if (info->irq && info->irq != UIO_IRQ_CUSTOM)
+               free_irq(info->irq, idev);
 
        device_destroy(&uio_class, MKDEV(uio_major, idev->minor));
 
@@ -895,6 +897,7 @@ static int __init uio_init(void)
 static void __exit uio_exit(void)
 {
        release_uio_class();
+       idr_destroy(&uio_idr);
 }
 
 module_init(uio_init)