From: anton Date: Mon, 8 Nov 2021 07:05:21 +0000 (+0000) Subject: Plug uhidev memory leak during detach. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a49bda3da34f8c7378f4d28379221bc214459a09;p=openbsd Plug uhidev memory leak during detach. Thanks to Damien Couderc for testing and ok gnezdo@ --- 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); }