Add a default case to a usb_tap() switch statement which mpi@ says will
authorjsg <jsg@openbsd.org>
Mon, 19 Feb 2018 09:20:45 +0000 (09:20 +0000)
committerjsg <jsg@openbsd.org>
Mon, 19 Feb 2018 09:20:45 +0000 (09:20 +0000)
never be called to convince compilers and static analysis tools a path
that uses uninitialised memory does not exist.

ok krw@ mpi@

sys/dev/usb/usb.c

index 0320d15..a2f3c56 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: usb.c,v 1.116 2018/02/19 08:59:52 mpi Exp $   */
+/*     $OpenBSD: usb.c,v 1.117 2018/02/19 09:20:45 jsg Exp $   */
 /*     $NetBSD: usb.c,v 1.77 2003/01/01 00:10:26 thorpej Exp $ */
 
 /*
@@ -1020,6 +1020,8 @@ usb_tap(struct usbd_bus *bus, struct usbd_xfer *xfer, uint8_t dir)
                uph->uph_hlen = htole16(sizeof(*uph));
                uph->uph_xfertype = USBPCAP_TRANSFER_INTERRUPT;
                break;
+       default:
+               return;
        }
 
        uph->uph_id = 0; /* not yet used */