summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authoranton <anton@cvs.openbsd.org>2021-02-11 06:53:45 +0000
committeranton <anton@cvs.openbsd.org>2021-02-11 06:53:45 +0000
commit0b37b0cb5c609c4c0dddf28f21795bcd8043bd3f (patch)
tree876c5d4341b78aa22d1194199cf441bcf069d229 /sys/dev
parentb45ed83ada007d7045b6267b577344c3070f06e8 (diff)
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@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/uhidev.c10
1 files changed, 6 insertions, 4 deletions
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;
}
}