From nobody Sun Dec 01 04:57:09 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 4Y1F5L4NBcz5gD60; Sun, 01 Dec 2024 04:57:10 +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 4Y1F5L0h8tz49C9; Sun, 1 Dec 2024 04:57:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733029030; 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=+BYZm3VPaQ1g+e7O9rI8/oGruIbiEnc9464cRMbH1DU=; b=Q/rauaz4XlwNsBVRsCoGntXt4yxVwvERensKlLvZQtD1eD7UTy7/DBgC+GXB8ar2yc9whA dvMvJMrV95X+Sdz7h08q9+YKUDz18CV5a16Mv247K80TxhcHyItq/fptfuWBXa2+OsjlrO /aWz1iwZlOZOcS1FNZKPMhMBGFUQH8no0goSDSzs8I/iCXvpwMDHM+EU72QcMm47HivZiQ 9jKLJTc+i707E0ekKl4nPFoB/lhzrYePGTTMXAsa5fwKzdp77bX/NgDuzbhGTqS7Ny27Pe KBdEUg0IfMLzvKsy/IvJdLhThxs9G3Syj8U/9wa1Nc9QYrMMXSTPiKHqQghAJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733029030; 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=+BYZm3VPaQ1g+e7O9rI8/oGruIbiEnc9464cRMbH1DU=; b=D/PnMQZO3+myFjEv+lmzjJTREO59scvYMRfumB5ri/j7O16fAw4wVlBCncWRdv9k2t2rT2 LwG9upZ84QK0jhIM7Q1pAzkAucZauPme6LZ4KrGBBT5qGEsYtccbFFcz5WtoF26rlNV0eM zpyy0QstWdaFmc6w1jZdzUzGCNqaHUobTEzqjy05GNUTsLQKN3ikBtqnBO05HqTOxQsVDN XKte8VQNPEJIwvEqWWXxTFUDu2N8JqdmDRGbWcTyD2ZUBDWFTrLxzznn2bp9NjGVvITPrD MWE5zf4SHmXcuxsPLTw44eZP8jmEy1cx7BOSlFKMr00QfxHr6+5kQkxM0cLVeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733029030; a=rsa-sha256; cv=none; b=fmcSKJ8Sii1zM1pSDziRoa/vK6v1HeEUd3rsjOY+6LeonH3FI4lSDMVN9wRzRpt/Zup6iL /R29nlMLEIuJn7OrBPAX489nnkf+7tVuP4UeyqYcZG1LhdDpHK61AcYB+Oo6nxC5euLzdh J1gJDHDbYdpL2seuutOQFJVTQ5SZmbgKqhSbtaVUMvFQi3IOBDn+eaBpeW4lc7UV3JlOgR XM/4PxpnaUhi/7IBFVravaoz4HweMwJjc8tGsnoRNHycSmUWYoz7bKPsLAL+dAsu9dLR3b 8JKfZ/zh0Z+r8wHoW4kONudvyHJPbSOl6dSj4HvnWMI96MpNYvPHvdy4Ly+Qqw== 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 4Y1F5L0GXWzfLG; Sun, 1 Dec 2024 04:57:10 +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 4B14v9gW095130; Sun, 1 Dec 2024 04:57:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B14v9nC095127; Sun, 1 Dec 2024 04:57:09 GMT (envelope-from git) Date: Sun, 1 Dec 2024 04:57:09 GMT Message-Id: <202412010457.4B14v9nC095127@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: 75da18816155 - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: 75da18816155847279cd0daaad0f29fb626de820 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=75da18816155847279cd0daaad0f29fb626de820 commit 75da18816155847279cd0daaad0f29fb626de820 Author: John Baldwin AuthorDate: 2024-11-01 14:08:52 +0000 Commit: John Baldwin CommitDate: 2024-12-01 02:46:06 +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 c5d1f18df17c..55ed4ec31284 100644 --- a/sys/dev/ow/ow.c +++ b/sys/dev/ow/ow.c @@ -331,6 +331,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) { @@ -561,7 +567,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); @@ -578,8 +583,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); @@ -704,6 +707,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, ow_child_pnpinfo), DEVMETHOD(bus_read_ivar, ow_read_ivar), DEVMETHOD(bus_write_ivar, ow_write_ivar),