From nobody Fri Nov 01 14:13:11 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 4Xg2rl4Rfjz5bpgZ; Fri, 01 Nov 2024 14:13:11 +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 4Xg2rl1jJfz4bg9; Fri, 1 Nov 2024 14:13:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470391; 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=+4bGpnd7USUgscf/tx6COdth6RsO6t3M+LOKDsrv5lw=; b=M7Yp7tg1zgun3Vx6c8AK7lKsBFvz8CSLFntJn2eH4pswjx4pivoW8PjO34CLNb67YdLGhM 3G/583jxEv8ec8RLXVMZcE74RLFDYMzyl+3aFygm/ySls/bmed8yRIZ5WDfY48dW7YZ2rR o+vGOxENUV+sGCfp5D6FmMW8CzdyH4U6FGKw1er3YFw12Ofs1QwCiqb3mgn4C3+L1THER8 Qf/1WbjD89IV6rjSKyEhMznH3AKUvEP6UTBq7pQTEJQkIgG/Rp+std+mdzJvRAgj8Rbpxz V8FKJ3Nf/wsSTUqSQO615YKyy93q0lRtxQP8/ALjJn8qkBakejWqq4Mgw+AKjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730470391; 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=+4bGpnd7USUgscf/tx6COdth6RsO6t3M+LOKDsrv5lw=; b=ZToHCdZm/m5qcy3CXT4mFagC0naW4kLRCKPejnSEzmwVWXqu2ESDUZbd4r9+YDWED5x4xk YlDRFJIxKDRDouRPDFtG9rEsUJ8q9F9+yajg4uXV12QQqwUv/8D1DGxDu4a3gWu2C0lwsq YnnVYnsE6Xll0awnfX/a6hlDdZ/kQbEyRmEte9TQ9rrkkAd7wLD00tpUesw80OM1ZcV0op CVcaSsUs6fCxudmmbjbmdqwyUc0UTLQr3XQwpk182auwTWvGksvLmTofGAEPLWLVNdDLkD vKCwGIuQ4MX3UAm4Kl7I7Wf6TfUumdpUWpITB/XFYoeU+Kufo08QLYkfSpNFrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730470391; a=rsa-sha256; cv=none; b=vy/hbZFhPh8mj3f7lG7z8f2S+I16CatfYyqLkoYJLN8gY4QnuT5GlMrpoFULUghnY5lwSk ZYQfxxInBq8dmWgc9/UfeXj79MLSgn1tDTInJU0JgPbi0/iPRT290gJN66Aky79mbbtkcL ngFUrcAOGIJAeFF9REkOPzk3pX34oRcMKZqF3TbTwW+gqswwDVjTqEaqnd98fb9yYuynub ZFjTqjihP6DdlL2yURqu2zkL3EWoI5lYUClfv5b4WHf+dYk64PpRIAuZkbx+yP+bTaB+jp IY1EKc6jf/06POwVsRsnMhV0ax1WJMR2DCNiADf4XL/UhuRn+m21gonUH3/jXw== 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 4Xg2rl19V9zP0w; Fri, 1 Nov 2024 14:13:11 +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 4A1EDBWa059821; Fri, 1 Nov 2024 14:13:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A1EDBmo059818; Fri, 1 Nov 2024 14:13:11 GMT (envelope-from git) Date: Fri, 1 Nov 2024 14:13:11 GMT Message-Id: <202411011413.4A1EDBmo059818@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 03f641f9b1d8 - main - smbus: 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/main X-Git-Reftype: branch X-Git-Commit: 03f641f9b1d82b7369c8988afbd75a32d9913aaf Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=03f641f9b1d82b7369c8988afbd75a32d9913aaf commit 03f641f9b1d82b7369c8988afbd75a32d9913aaf Author: John Baldwin AuthorDate: 2024-11-01 14:10:10 +0000 Commit: John Baldwin CommitDate: 2024-11-01 14:10:10 +0000 smbus: Use a bus_child_deleted method to free ivars for children Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47372 --- sys/dev/smbus/smbus.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/dev/smbus/smbus.c b/sys/dev/smbus/smbus.c index eed1aa6efce0..b0983fa32c30 100644 --- a/sys/dev/smbus/smbus.c +++ b/sys/dev/smbus/smbus.c @@ -112,6 +112,12 @@ smbus_add_child(device_t dev, u_int order, const char *name, int unit) return (child); } +static void +smbus_child_deleted(device_t dev, device_t child) +{ + free(device_get_ivars(child), M_DEVBUF); +} + static void smbus_hinted_child(device_t bus, const char *dname, int dunit) { @@ -222,6 +228,7 @@ static device_method_t smbus_methods[] = { /* bus interface */ DEVMETHOD(bus_add_child, smbus_add_child), + DEVMETHOD(bus_child_deleted, smbus_child_deleted), DEVMETHOD(bus_hinted_child, smbus_hinted_child), DEVMETHOD(bus_probe_nomatch, smbus_probe_nomatch), DEVMETHOD(bus_child_location, smbus_child_location),