From: Mauro Carvalho Chehab Date: Fri, 29 Jul 2011 05:26:59 +0000 (-0300) Subject: [media] em28xx: Fix IR unregister logic X-Git-Tag: MMI-PSA29.97-13-9~18177^2~342 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6d51477470728074cea396a0127d73c5590dd441;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git [media] em28xx: Fix IR unregister logic The input stop() callback already calls the em28xx_ir_stop method. Calling it again causes an oops. Acked-by: Jarod Wilson Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/em28xx/em28xx-input.c b/drivers/media/video/em28xx/em28xx-input.c index 5d12b14282e3..679da4804281 100644 --- a/drivers/media/video/em28xx/em28xx-input.c +++ b/drivers/media/video/em28xx/em28xx-input.c @@ -463,11 +463,11 @@ int em28xx_ir_fini(struct em28xx *dev) if (!ir) return 0; - em28xx_ir_stop(ir->rc); - rc_unregister_device(ir->rc); - kfree(ir); + if (ir->rc) + rc_unregister_device(ir->rc); /* done */ + kfree(ir); dev->ir = NULL; return 0; }