uio: don't free irq that was not requested
authorStephen Hemminger <stephen@networkplumber.org>
Thu, 14 May 2015 16:19:13 +0000 (09:19 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 May 2015 18:55:15 +0000 (11:55 -0700)
UIO base driver should only free_irq that it has requested.
UIO supports drivers without interrupts (irq == 0) or custom handlers.

This fixes warnings like:

WARNING: CPU: 1 PID: 5478 at kernel/irq/manage.c:1244 __free_irq+0xa9/0x1e0()
Trying to free already-free IRQ 0

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/uio/uio.c

index 65bf0676d54afc785107822f51a696ae373a2702..3257d4220d0102e876b8aa7888865797a616123e 100644 (file)
@@ -879,7 +879,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));