[media] em28xx: Fix IR unregister logic
authorMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 29 Jul 2011 05:26:59 +0000 (02:26 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 31 Jul 2011 03:51:11 +0000 (00:51 -0300)
The input stop() callback already calls the em28xx_ir_stop method.
Calling it again causes an oops.

Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/em28xx/em28xx-input.c

index 5d12b14282e3dc19353f62831b3d5df1d7757f6f..679da480428113ec8d7da347e722bf36bde6e590 100644 (file)
@@ -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;
 }