From 0b37b0cb5c609c4c0dddf28f21795bcd8043bd3f Mon Sep 17 00:00:00 2001 From: anton Date: Thu, 11 Feb 2021 06:53:45 +0000 Subject: If uhidev_set_report_dev() already have been invoked for the given report id, there's no point in trying to find a matching sub device. ok mglocker@ --- sys/dev/usb/uhidev.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/usb/uhidev.c b/sys/dev/usb/uhidev.c index 9915b660d9d..2999e40cc52 100644 --- a/sys/dev/usb/uhidev.c +++ b/sys/dev/usb/uhidev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhidev.c,v 1.86 2021/02/04 16:18:34 anton Exp $ */ +/* $OpenBSD: uhidev.c,v 1.87 2021/02/11 06:53:44 anton Exp $ */ /* $NetBSD: uhidev.c,v 1.14 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -273,11 +273,13 @@ uhidev_attach(struct device *parent, struct device *self, void *aux) hid_report_size(desc, size, hid_feature, repid) == 0) continue; + /* Could already be assigned by uhidev_set_report_dev(). */ + if (sc->sc_subdevs[repid] != NULL) + continue; + uha.reportid = repid; dev = config_found_sm(self, &uha, uhidevprint, uhidevsubmatch); - /* Could already be assigned by uhidev_set_report_dev(). */ - if (sc->sc_subdevs[repid] == NULL) - sc->sc_subdevs[repid] = (struct uhidev *)dev; + sc->sc_subdevs[repid] = (struct uhidev *)dev; } } -- cgit v1.2.3