Module Name: src
Committed By: jdolecek
Date: Sun May 31 18:20:24 UTC 2020
Modified Files:
src/sys/dev/usb: usb_subr.c
Log Message:
also set ifc->ui_endpoints to NULL in usbd_free_iface_data() when the value
is freed, to make it impossible to re-enter this by mistake
very likely has no effect for the syzbot problem, but good to do nevetheless
Reported-by: [email protected]
To generate a diff of this commit:
cvs rdiff -u -r1.245 -r1.246 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.245 src/sys/dev/usb/usb_subr.c:1.246
--- src/sys/dev/usb/usb_subr.c:1.245 Sun May 31 17:52:58 2020
+++ src/sys/dev/usb/usb_subr.c Sun May 31 18:20:23 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: usb_subr.c,v 1.245 2020/05/31 17:52:58 maxv Exp $ */
+/* $NetBSD: usb_subr.c,v 1.246 2020/05/31 18:20:23 jdolecek 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.245 2020/05/31 17:52:58 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.246 2020/05/31 18:20:23 jdolecek Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -507,6 +507,7 @@ usbd_free_iface_data(struct usbd_device
int nendpt = ifc->ui_idesc->bNumEndpoints;
size_t sz = nendpt * sizeof(struct usbd_endpoint);
kmem_free(ifc->ui_endpoints, sz);
+ ifc->ui_endpoints = NULL;
}
}