From nobody Sun Dec 01 04:58:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Y1F6K3Kfrz5gDFp; Sun, 01 Dec 2024 04:58:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y1F6K1PrMz4Cwp; Sun, 1 Dec 2024 04:58:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733029081; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/FQrdhyEG4j5QT1kZ8shL4DGTmeNdQn2xyTnhmvntzU=; b=fwQMR4ALjYbsP5b2gQWp5iLUzVDTZfx2JxmWfYcolKN0je/Bdak4bGpqaI4en4++RWEyTI x3lvQ6O2pUnxnv4JK4CzzXcrfBto/r0AhBd7TwMxId2kpTBi2XsrKVshyv85Id1op4fJu0 T1h+gAFX2FdKCBTco4dl36/Cd/hgKFGVPTJsV7ACs0b5+6W/sbQbQogESbJ/Jawa660ojU LZQUTfMvSzIPNXnzj3xbrEGg3wTc9GvO52c5HtmgjaOmSFopJII1vUIoAJJMGshLSyQvtX m0MBDYNA0D85EJpXkJ+/yUbLXB7tyLgD9OrlOQyT32Bd+rOHBzdtueD+khbueg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733029081; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/FQrdhyEG4j5QT1kZ8shL4DGTmeNdQn2xyTnhmvntzU=; b=uGT2XVmIrLVpKslJbszOOIo8WxcoAEQP92AXaLy8cL1lLjB7dvtmD7UNFsDukYBspUpaYP jUarRh/iYJfiXJ4xtdAIbt9IYT1WpN+nDwmSMWR9ACpQcwBdncWTUsWkpQiw3G4UasGJcw QjIGBqRA+4EZYwlII3CdmOTgSi/540sJz8YPiKHNiRaMK+2qATsRrfaoYX2mwRDHOV0scq dOBvLdxPMqNjZevabMHo+L+WfGx1fs6X/1WWx9Segn8yTRLHidAl08x2/9kvvTV3hBBvr1 PlJimxGDzvosMoGCMMqjSFQ9OC8w7Iwh0X0v5n3yGFub492dRVEKfLtV8gVGBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733029081; a=rsa-sha256; cv=none; b=ejRc0CLJjQJaw5NVoGjWdmA0yg5wxOJF2rFB/49qnCsFChTK+uBg/gWSNjjn4QHDDeC1yp ZhenYvVX0tbOZsVo/MHO7/isctnFPmZw3QneuKyXb/ArL+Pqh4FpOc3Hggct4cB22GvoUt G168z/sKGSGgYnjb+l7AtO32zh3QI2D10/13H41iyJf4c1orBTq2FMXa72JEawZBKvCsow PnGweGZaLvGnorChL0B3RMgiHBLNaimY00vzrzxeksDn2wLbJoeMH3KHFwSqEth1xoevjX bm1M5ZXF/nZesnoZBwQgY/aKT3mtU+7Q6i09912ebAZll/SsiqKm2JmyZz1UzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Y1F6K0z4rzf7X; Sun, 1 Dec 2024 04:58:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4B14w1Rj097618; Sun, 1 Dec 2024 04:58:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B14w190097615; Sun, 1 Dec 2024 04:58:01 GMT (envelope-from git) Date: Sun, 1 Dec 2024 04:58:01 GMT Message-Id: <202412010458.4B14w190097615@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 8973edf29b3d - stable/13 - superio: Use a bus_child_deleted method to free ivars for children List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8973edf29b3dffb31b0b481ad462121e50cd3c67 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8973edf29b3dffb31b0b481ad462121e50cd3c67 commit 8973edf29b3dffb31b0b481ad462121e50cd3c67 Author: John Baldwin AuthorDate: 2024-11-01 14:09:21 +0000 Commit: John Baldwin CommitDate: 2024-11-30 21:43:37 +0000 superio: Use a bus_child_deleted method to free ivars for children Previously these ivars were leaked. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47367 (cherry picked from commit 2520675d3f0ef9039049fd67481f013b36f250ee) --- sys/dev/superio/superio.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sys/dev/superio/superio.c b/sys/dev/superio/superio.c index dd25a7176d5f..3ad06e04d5cf 100644 --- a/sys/dev/superio/superio.c +++ b/sys/dev/superio/superio.c @@ -710,6 +710,18 @@ superio_add_child(device_t dev, u_int order, const char *name, int unit) return (child); } +static void +superio_child_deleted(device_t dev, device_t child) +{ + struct superio_devinfo *dinfo; + + dinfo = device_get_ivars(child); + if (dinfo == NULL) + return; + resource_list_free(&dinfo->resources); + free(dinfo, M_DEVBUF); +} + static int superio_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) { @@ -1001,6 +1013,7 @@ static device_method_t superio_methods[] = { DEVMETHOD(device_resume, bus_generic_resume), DEVMETHOD(bus_add_child, superio_add_child), + DEVMETHOD(bus_child_deleted, superio_child_deleted), DEVMETHOD(bus_child_detached, superio_child_detached), DEVMETHOD(bus_child_location_str, superio_child_location_str), DEVMETHOD(bus_child_pnpinfo_str, superio_child_pnp_str),