From 1beb5a7d1b17f187491599410709fd0544ea1c16 Mon Sep 17 00:00:00 2001 From: Sean Young Date: Wed, 17 May 2017 14:32:50 -0300 Subject: [PATCH] [media] sir_ir: attempt to free already free_irq If the probe fails (e.g. port already in use), rmmod causes null deref. Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab --- drivers/media/rc/sir_ir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/rc/sir_ir.c b/drivers/media/rc/sir_ir.c index 90a5f8fd5eea..c27d6b406d7c 100644 --- a/drivers/media/rc/sir_ir.c +++ b/drivers/media/rc/sir_ir.c @@ -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); } -- 2.20.1