From a49bda3da34f8c7378f4d28379221bc214459a09 Mon Sep 17 00:00:00 2001 From: anton Date: Mon, 8 Nov 2021 07:05:21 +0000 Subject: [PATCH] Plug uhidev memory leak during detach. Thanks to Damien Couderc for testing and ok gnezdo@ --- sys/dev/usb/uhidev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/uhidev.c b/sys/dev/usb/uhidev.c index 014dc052c1c..7e196395d2f 100644 --- a/sys/dev/usb/uhidev.c +++ b/sys/dev/usb/uhidev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhidev.c,v 1.95 2021/09/12 06:58:08 anton Exp $ */ +/* $OpenBSD: uhidev.c,v 1.96 2021/11/08 07:05:21 anton Exp $ */ /* $NetBSD: uhidev.c,v 1.14 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -451,6 +451,7 @@ uhidev_detach(struct device *self, int flags) sc->sc_subdevs[i] = NULL; } + free(sc->sc_subdevs, M_USBDEV, sc->sc_nrepid * sizeof(struct uhidev *)); return (rv); } -- 2.20.1