[PATCH v2 2/2] media: rc: ati_remote: fix NULL input_dev when mouse=0
From: YuanZhe Liu
Date: Mon Oct 26 2026 - 09:11:35 EST
The "mouse" module parameter disables the mouse input device, but the
rc device is still registered and opening it submits the interrupt URB.
ati_remote_input_report() translates scancodes 0x70-0x7e through the
mouse table and reports them through ati_remote->idev, which is never
assigned in that case, so input_event() is called with a NULL device
and dereferences it.
The driver used to return early from ati_remote_input_report() when
there was no mouse device, but that check was dropped when the scancode
handling was reworked for the Medion X10 Digitainer remote. Restore it
so that mouse events are dropped when the mouse device is disabled,
while remote key scancodes are still handled by rc-core.
Fixes: 9d454d48ebcd ("[media] ati_remote: add support for Medion X10 Digitainer remote")
Cc: stable@xxxxxxxxxxxxxxx
Co-developed-by: Bin Yu <byu@xxxxxxxxxxxxx>
Signed-off-by: Bin Yu <byu@xxxxxxxxxxxxx>
Co-developed-by: Cheng Wen <wencheng@xxxxxxxxxxxxx>
Signed-off-by: Cheng Wen <wencheng@xxxxxxxxxxxxx>
Signed-off-by: YuanZhe Liu <25031212351@xxxxxxxxxxxxxxxxx>
---
drivers/media/rc/ati_remote.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/media/rc/ati_remote.c b/drivers/media/rc/ati_remote.c
index 8543612d5a60..5b33097c59e1 100644
--- a/drivers/media/rc/ati_remote.c
+++ b/drivers/media/rc/ati_remote.c
@@ -551,6 +551,9 @@ static void ati_remote_input_report(struct urb *urb)
}
}
+ if (index >= 0 && !dev)
+ return; /* no mouse device */
+
if (index >= 0 && ati_remote_tbl[index].kind == KIND_LITERAL) {
/*
* The lsbit of the raw key code is a down/up flag.
--
2.34.1