diff mbox series

[2/3] USB: imon: fix timer racing disconnect

Message ID 20220428133455.3200-2-oneukum@suse.com (mailing list archive)
State New, archived
Headers show
Series [1/3] USB: imon: avoid needless atomic allocations in resume | expand

Commit Message

Oliver Neukum April 28, 2022, 1:34 p.m. UTC
The timer will report events for an input device.
Reporting events for an unregistered device is bad.
Hence the timer must be killed first.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
 drivers/media/rc/imon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c
index 761b7fa57378..8dbeab48ed3c 100644
--- a/drivers/media/rc/imon.c
+++ b/drivers/media/rc/imon.c
@@ -2537,8 +2537,8 @@  static void imon_disconnect(struct usb_interface *interface)
 		usb_kill_urb(ictx->rx_urb_intf1);
 		usb_put_dev(ictx->usbdev_intf1);
 		if (ictx->display_type == IMON_DISPLAY_TYPE_VGA) {
-			input_unregister_device(ictx->touch);
 			del_timer_sync(&ictx->ttimer);
+			input_unregister_device(ictx->touch);
 		}
 	}