[PATCH] HID: wacom: Prevent NULL dereference in wireless work
From: Devarjya Purkayastha
Date: Fri Oct 30 2026 - 13:35:44 EST
wacom_wireless_work() assumes that the active USB configuration has
three interfaces and unconditionally accesses interface[1] and
interface[2].
A malformed configuration with fewer interfaces can therefore cause a
NULL pointer dereference in the wireless workqueue. Return early unless
the configuration has at least three interfaces.
Reported-by: Indrath <indrathftw@xxxxxxxxx>
Signed-off-by: Devarjya Purkayastha <unseentactician27062006@xxxxxxxxx>
---
drivers/hid/wacom_sys.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index 628372ab818a..dcf2811a5c48 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -2619,7 +2619,7 @@ static void wacom_wireless_work(struct work_struct *work)
wacom_destroy_battery(wacom);
- if (!usbdev)
+ if (!usbdev || usbdev->config->desc.bNumInterfaces < 3)
return;
/* Stylus interface */
--
2.53.0