From e258532fda255a5c78cbb3b2e49e2d2790bbed31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bo=20St=C3=A5le=20Kopperud?= Date: Mon, 8 Jun 2026 20:18:28 +0200 Subject: [PATCH] hid.class: ignore zero-length input reports A zero-length reply (USB ZLP, buflen 0) means the device has nothing to report. Guard the Wacom-validity check with buflen > 0 so an empty report is no longer mistaken for a bad packet. --- rom/usb/classes/hid/hid.class.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rom/usb/classes/hid/hid.class.c b/rom/usb/classes/hid/hid.class.c index 5fb5d89f2c8..bc95d953967 100644 --- a/rom/usb/classes/hid/hid.class.c +++ b/rom/usb/classes/hid/hid.class.c @@ -902,7 +902,11 @@ AROS_UFH0(void, GM_UNIQUENAME(nHidTask)) { wacomgood = nParseWacom(nch, buf, buflen); } - if(!wacomgood) + /* + * A zero-length reply (USB ZLP / buflen=0) + * means "device has nothing to report". + */ + if(!wacomgood && buflen > 0) { // if the parser failed, use standard methods if(nch->nch_UsesReportID) @@ -7458,4 +7462,3 @@ LONG nEasyRequestA(struct NepHidBase *nh, STRPTR body, STRPTR gadgets, RAWARG pa return(EasyRequestArgs(NULL, &es, NULL, params)); } /* \\\ */ -