summaryrefslogtreecommitdiffstats
path: root/usr.sbin/usbd
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/usbd')
-rw-r--r--usr.sbin/usbd/usbd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/usbd/usbd.c b/usr.sbin/usbd/usbd.c
index b866eca..06e7637 100644
--- a/usr.sbin/usbd/usbd.c
+++ b/usr.sbin/usbd/usbd.c
@@ -702,7 +702,12 @@ find_action(struct usb_device_info *devinfo, action_match_t *action_match)
(action->devname == WILDCARD_STRING ||
(match = match_devname(action, devinfo)) != -1)) {
/* found match !*/
- if (match != -1)
+
+ /* Find a devname for pretty printing. Either
+ * the matched one or otherwise, if there is only
+ * one devname for that device, use that.
+ */
+ if (match >= 0)
devname = devinfo->devnames[match];
else if (devinfo->devnames[0][0] != '\0' &&
devinfo->devnames[1][0] == '\0')
OpenPOWER on IntegriCloud