[media] sir_ir: attempt to free already free_irq
authorSean Young <sean@mess.org>
Wed, 17 May 2017 17:32:50 +0000 (14:32 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 6 Jun 2017 12:14:23 +0000 (09:14 -0300)
If the probe fails (e.g. port already in use), rmmod causes null deref.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/rc/sir_ir.c

index 90a5f8f..c27d6b4 100644 (file)
@@ -381,6 +381,8 @@ static int sir_ir_probe(struct platform_device *dev)
 
 static int sir_ir_remove(struct platform_device *dev)
 {
+       drop_hardware();
+       drop_port();
        return 0;
 }
 
@@ -421,8 +423,6 @@ pdev_alloc_fail:
 
 static void __exit sir_ir_exit(void)
 {
-       drop_hardware();
-       drop_port();
        platform_device_unregister(sir_ir_dev);
        platform_driver_unregister(&sir_ir_driver);
 }