Module Name: src Committed By: riastradh Date: Tue Apr 11 08:50:07 UTC 2023
Modified Files: src/sys/dev/usb: usb_subr.c Log Message: usb(9): Assert ud_ifaces is null before we clobber it. To generate a diff of this commit: cvs rdiff -u -r1.277 -r1.278 src/sys/dev/usb/usb_subr.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/usb_subr.c diff -u src/sys/dev/usb/usb_subr.c:1.277 src/sys/dev/usb/usb_subr.c:1.278 --- src/sys/dev/usb/usb_subr.c:1.277 Wed Apr 6 22:01:45 2022 +++ src/sys/dev/usb/usb_subr.c Tue Apr 11 08:50:07 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: usb_subr.c,v 1.277 2022/04/06 22:01:45 mlelstv Exp $ */ +/* $NetBSD: usb_subr.c,v 1.278 2023/04/11 08:50:07 riastradh Exp $ */ /* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */ /* @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.277 2022/04/06 22:01:45 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.278 2023/04/11 08:50:07 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd.h" @@ -867,6 +867,8 @@ usbd_set_config_index(struct usbd_device goto bad; } + KASSERTMSG(dev->ud_ifaces == NULL, "ud_ifaces=%p", dev->ud_ifaces); + /* Allocate and fill interface data. */ nifc = cdp->bNumInterface; if (nifc == 0) {