Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit da77b546 authored by Sean Young's avatar Sean Young Committed by Greg Kroah-Hartman
Browse files

media: rc: ensure close() is called on rc_unregister_device



[ Upstream commit 8e782fcf78275f505194e767c515202d4fd274bc ]

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: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent b0b10168
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1956,6 +1956,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);