From 20c312382ee8056c85ee735f8cec61c97af01cda Mon Sep 17 00:00:00 2001 From: anton Date: Wed, 25 Aug 2021 05:47:15 +0000 Subject: [PATCH] Prevent ucc(4) from matching report IDs with an empty input report. Fixes cwen@'s Creative BT-W3 audio device. --- sys/dev/usb/ucc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/ucc.c b/sys/dev/usb/ucc.c index 0e1986b83d3..cdd5d0f3c07 100644 --- a/sys/dev/usb/ucc.c +++ b/sys/dev/usb/ucc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ucc.c,v 1.8 2021/08/25 05:46:31 anton Exp $ */ +/* $OpenBSD: ucc.c,v 1.9 2021/08/25 05:47:15 anton Exp $ */ /* * Copyright (c) 2021 Anton Lindqvist @@ -141,6 +141,8 @@ ucc_match(struct device *parent, void *match, void *aux) if (!hid_is_collection(desc, size, uha->reportid, HID_USAGE2(HUP_CONSUMER, HUC_CONTROL))) return UMATCH_NONE; + if (hid_report_size(desc, size, hid_input, uha->reportid) == 0) + return UMATCH_NONE; return UMATCH_IFACECLASS; } -- 2.20.1