Module Name: src Committed By: maya Date: Tue Oct 10 11:43:26 UTC 2017
Modified Files: src/sys/dev/usb: usbdi_util.c Log Message: Reorder to test for null before null deref in debug code To generate a diff of this commit: cvs rdiff -u -r1.67 -r1.68 src/sys/dev/usb/usbdi_util.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/usb/usbdi_util.c diff -u src/sys/dev/usb/usbdi_util.c:1.67 src/sys/dev/usb/usbdi_util.c:1.68 --- src/sys/dev/usb/usbdi_util.c:1.67 Tue Oct 10 11:40:54 2017 +++ src/sys/dev/usb/usbdi_util.c Tue Oct 10 11:43:26 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: usbdi_util.c,v 1.67 2017/10/10 11:40:54 maya Exp $ */ +/* $NetBSD: usbdi_util.c,v 1.68 2017/10/10 11:43:26 maya Exp $ */ /* * Copyright (c) 1998, 2012 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: usbdi_util.c,v 1.67 2017/10/10 11:40:54 maya Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usbdi_util.c,v 1.68 2017/10/10 11:43:26 maya Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -314,9 +314,10 @@ usbd_get_protocol(struct usbd_interface USBHIST_FUNC(); USBHIST_CALLED(usbdebug); - DPRINTFN(4, "iface=%p, endpt=%d", iface, id->bInterfaceNumber, 0, 0); if (id == NULL) return USBD_IOERROR; + DPRINTFN(4, "iface=%p, endpt=%d", iface, id->bInterfaceNumber, 0, 0); + usbd_interface2device_handle(iface, &dev); req.bmRequestType = UT_READ_CLASS_INTERFACE; req.bRequest = UR_GET_PROTOCOL;