mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
UPSTREAM: media: rc: ensure close() is called on rc_unregister_device
If userspace has an open file descriptor on the rc input device or lirc
device when rc_unregister_device() is called, then the rc close() is
never called.
This ensures that the receiver is turned off on the nuvoton-cir driver
during shutdown.
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
(cherry picked from commit 8e782fcf78)
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
This commit is contained in:
@@ -1951,6 +1951,8 @@ void rc_unregister_device(struct rc_dev *dev)
|
||||
rc_free_rx_device(dev);
|
||||
|
||||
mutex_lock(&dev->lock);
|
||||
if (dev->users && dev->close)
|
||||
dev->close(dev);
|
||||
dev->registered = false;
|
||||
mutex_unlock(&dev->lock);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user