From nobody Sun Dec 01 04:57:58 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 4Y1F6H0bkzz5gDMf; Sun, 01 Dec 2024 04:57:59 +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 4Y1F6G6SrGz4Cqs; Sun, 1 Dec 2024 04:57:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733029078; 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=TyRksV3L818TqhDisQMWUVOsWGGwPV57A9WOPiD+4ds=; b=gpQqTdmGKLWOymjomDaMysfdMLkA9G0pbo5umBDvAMJoN1p4qNIXv/rrwoOSYhqvhxUWJW VbT9uGoGXhyO7E17rHDafVXMS4jrb4WuMp7GExcdZ5CxgbXco7Ij2E02T4OrF1IJtSCdXe WO5KjWF6vjpLQbUqAZsFExpSgafV5EuDR9oPxX7Y40cGRKoDn7c82en9lPwcd4UUz7kAsU lKiJ09YFmFqw+d/PzteBlkkZz5g3Y+/Ci6MmDn4mI80Qlesv2Xb83MNl1YUFUc/4vJoNYs hHeZ3HNrGhLwKoGYjphXiJkGGzm+VdQSzuGznJL/2sJhLmw+mYSSLiJhMZzqOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733029078; 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=TyRksV3L818TqhDisQMWUVOsWGGwPV57A9WOPiD+4ds=; b=pIE716ghwxNzd9kujlm5VKqnHiBnlMCgUtgpKiARzUUZKw8GDKiecJLukvqDrrvPQ/bBdc wJiZx6e7WcR7cLCMHsrm/wP5Zf050ws9iiXERXqN0wW5VlZKLS1MSj22Q3JZcaihYyBkt0 25m4oZyJGrSeUYm0qUokTm8Jtjvh2eLnlNZgoCRkiFk/d+EZ+IhqLsJIkJWXJ0jONXV0Or +8xfhMMwg9NxpyUBOcOGW4b9NRCJuREqgg8l+V9JK1ZYDGOti8vbq+HQZKgDH0YCYf4HTq IlKWpAB9oTB9KdFyVeMQHo5CbZnT/53tbtu9zYhhDJeBCNtdjZj1dcF3ylvq2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733029078; a=rsa-sha256; cv=none; b=iUx8+3TwFJFFot1LQWXt1zxFwoiS3ke5ZQjS9Owh4NDmi1BJO4Fac3i0eM35Ira2miLD4p pyQKxjVIylnYb78aox5Gp2wjGSEqI9JNNwIRVDkBZnidM4VIpuSxKPRugxaQLcPl1DjCco 2ZRBkEQZUyFnd2vKvM1Gtp9YuxXd49iHO5BAzVCgwDaFdoYfoHLlLD9wUZdJCyQmwRBgjT hpRnUtgqykRbJPpgivPTOYIa+on7NHs99HDf4w3EuVVJvbBFd8BcLUUhcE7Mb0D0nmMJg5 3Z/3jQi6R+f849TEc2FaQLghm3mouk3wgNiz4rcLx602Yt8qGMHlr1KLbHTOrQ== 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 4Y1F6G60T9zdn7; Sun, 1 Dec 2024 04:57:58 +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 4B14vwUI097484; Sun, 1 Dec 2024 04:57:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B14vwnr097481; Sun, 1 Dec 2024 04:57:58 GMT (envelope-from git) Date: Sun, 1 Dec 2024 04:57:58 GMT Message-Id: <202412010457.4B14vwnr097481@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: 190b7cd16067 - stable/13 - ow: 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: 190b7cd16067ae8d79066d604f99834d16841a13 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=190b7cd16067ae8d79066d604f99834d16841a13 commit 190b7cd16067ae8d79066d604f99834d16841a13 Author: John Baldwin AuthorDate: 2024-11-01 14:08:52 +0000 Commit: John Baldwin CommitDate: 2024-11-30 21:41:46 +0000 ow: Use a bus_child_deleted method to free ivars for children Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47364 (cherry picked from commit 79dfe2b761891eb3ab1b6a769d4f6adc97335350) --- sys/dev/ow/ow.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/dev/ow/ow.c b/sys/dev/ow/ow.c index 465df5d34438..9121e1b75653 100644 --- a/sys/dev/ow/ow.c +++ b/sys/dev/ow/ow.c @@ -330,6 +330,12 @@ ow_add_child(device_t dev, romid_t romid) return (0); } +static void +ow_child_deleted(device_t dev, device_t child) +{ + free(device_get_ivars(child), M_OW); +} + static device_t ow_child_by_romid(device_t dev, romid_t romid) { @@ -560,7 +566,6 @@ ow_detach(device_t ndev) { device_t *children, child; int nkid, i; - struct ow_devinfo *di; struct ow_softc *sc; sc = device_get_softc(ndev); @@ -577,8 +582,6 @@ ow_detach(device_t ndev) return ENOMEM; for (i = 0; i < nkid; i++) { child = children[i]; - di = device_get_ivars(child); - free(di, M_OW); device_delete_child(ndev, child); } free(children, M_TEMP); @@ -719,6 +722,7 @@ static device_method_t ow_methods[] = { DEVMETHOD(device_detach, ow_detach), /* Bus interface */ + DEVMETHOD(bus_child_deleted, ow_child_deleted), DEVMETHOD(bus_child_pnpinfo_str, ow_child_pnpinfo_str), DEVMETHOD(bus_child_location_str, ow_child_location_str), DEVMETHOD(bus_read_ivar, ow_read_ivar),