From: jsg Date: Mon, 19 Feb 2018 09:20:45 +0000 (+0000) Subject: Add a default case to a usb_tap() switch statement which mpi@ says will X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a126f02088f3f363f217db416d602195e9be70c5;p=openbsd Add a default case to a usb_tap() switch statement which mpi@ says will never be called to convince compilers and static analysis tools a path that uses uninitialised memory does not exist. ok krw@ mpi@ --- diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c index 0320d153835..a2f3c568bc8 100644 --- a/sys/dev/usb/usb.c +++ b/sys/dev/usb/usb.c @@ -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 */