[media] em28xx: input: fix oops on device removal
authorFrank Schaefer <fschaefer.oss@googlemail.com>
Sat, 22 Dec 2012 13:13:38 +0000 (10:13 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 22 Dec 2012 18:14:37 +0000 (16:14 -0200)
commit2f5741aa6a71aea6bc8f186e8753f270ae8742f1
treeda9668f3a6886514347ad8c907c477ce4c9b3a5e
parent0dae88392395e228e67436cd08f084d395b39df5
[media] em28xx: input: fix oops on device removal

When em28xx_ir_init() fails due to an configuration error, it frees the memory
of struct em28xx_IR *ir, but doesn't set the corresponding pointer in the
device struct to NULL.
On device removal, em28xx_ir_fini() gets called, which then calls
rc_unregister_device() with a pointer to freed memory.
Fixes bug 26572 (http://bugzilla.kernel.org/show_bug.cgi?id=26572)

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/usb/em28xx/em28xx-input.c