media: lirc: do not call close() or open() on unregistered devices
authorSean Young <sean@mess.org>
Sat, 23 Sep 2017 21:44:03 +0000 (17:44 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Thu, 14 Dec 2017 15:35:19 +0000 (10:35 -0500)
commitcb84343fced1febb5b21a9ef9082a07bfc3e7427
tree769f5c01f820e7eac7ecde2c01ff954f0f78a9bc
parent7790e81f7e1f7f122f8fcccd91443a2571421aba
media: lirc: do not call close() or open() on unregistered devices

If a lirc chardev is held open after a device is unplugged, rc_close()
will be called after rc_unregister_device(). The driver is not expecting
any calls at this point, and the iguanair driver causes an oops in
this scenario.

rc_open() can be called when the device is removed too, by calling open
on the chardev whilst the device is being removed.

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