From nobody Sun Dec 01 04:58:06 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 4Y1F6R0hcWz5gD47; Sun, 01 Dec 2024 04:58:07 +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 4Y1F6Q75KDz4DBW; Sun, 1 Dec 2024 04:58:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733029087; 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=PZx1YgNaPyGbN9qzSF1pp8g6MEhLYkd5MjyQoSEXpZ0=; b=DI2Gvkjdh1GxN4Qipj0Fgx/JTOB07L+wSq58PKCZR2wm2EJHnwSE3BHcIwFlI7rEYeP/gn 1qOVo+qnCc1cpEZOJPXEkgBKtY/dVRYRz5YPe4wXpI6OGdga4f/W/ft6PRY6MG7CaMUKkV q/ZwYilrnTQt52ESCEMDJouPmvMr9l/V5mZnLrJxL2EC5Km/R76/CqwnbOUmUospbyzL34 N4tzpUIqzfQWXorpkBnY/D+dMAnCDj7gwKXbe1bfEzrYZMpx9NsSQnBg+gtEDOG22EEyY9 pJFut1n8N6k5V2XqSllH/638JSTtWoBUby7PQBsO+Va4l4ZF9ywikrFiCTqc+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733029087; 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=PZx1YgNaPyGbN9qzSF1pp8g6MEhLYkd5MjyQoSEXpZ0=; b=Q3oDY/YPpLgTjhd44fJKdiolfCb8kN5fLMAAC5jiZXUWil9sWk1M7gIkKzt7sZLbuBAbF3 bjyB4iuuEMLyCuOTLQb/onsK7+iXXIBuFN7v8wxU0bpGNBlTHezbjHXpPZ7MDbp1IkcNga aL/yTnTcw1c/xWj9mrX27xpJ+1DHPB9LjVaS7Fvf3+NsUb/l1WwdNAC110JQr0lNY6l7cZ /NIrm/LYWuwG1u0YAZ/LqzIO3eA0M9gwBafCWshuqbBDXTltSaatS4YZcTF8rBNQSA1Tcw Q2Mu+o1aG13WwosWHmqvhPvxWyi00KpeJD3XJGYfuzaF/GgSKwQCc5RLJgCT7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733029087; a=rsa-sha256; cv=none; b=gXZHxIdFy30z1zs5lFmUqaT0JhEPvJdoZjdgEK7Bl9gOBoTKHF+hCBU+0Z4RdWC6G8ecup MVVDBBPv0isanoTuxDddqRPUnLVKEjYktttx6/okyRQ3iAFyguWWKI6lbltBm9kN8pDROg Odoaul86wqLveapNr/mR3tltQYvFbADllhsODP/owhvM8O+XF1Dxc/g/5QMDjbMkTdk5Ad 4XXJgKGTf5kVoZy+O+RN7Q99i1I0dGJnvyU+kpwDPn3dqNGyWXPFA6mDDhjxCFHdbBV24i b0ZuHgRtXWwHx9sNqlGkP9Svabir+NUbNNyBPjUPYyKaPhIcaO96tEL4oUvA4g== 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 4Y1F6Q6fgQzf7b; Sun, 1 Dec 2024 04:58:06 +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 4B14w61p097933; Sun, 1 Dec 2024 04:58:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B14w67G097930; Sun, 1 Dec 2024 04:58:06 GMT (envelope-from git) Date: Sun, 1 Dec 2024 04:58:06 GMT Message-Id: <202412010458.4B14w67G097930@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: a6586a518bc2 - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: a6586a518bc2a06de53babc9d8f8b964fe4647f5 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a6586a518bc2a06de53babc9d8f8b964fe4647f5 commit a6586a518bc2a06de53babc9d8f8b964fe4647f5 Author: John Baldwin AuthorDate: 2024-11-01 14:10:10 +0000 Commit: John Baldwin CommitDate: 2024-11-30 21:45:44 +0000 smbus: Use a bus_child_deleted method to free ivars for children Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47372 (cherry picked from commit 03f641f9b1d82b7369c8988afbd75a32d9913aaf) --- 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 988e05e8ea75..2eb840a05c44 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) { @@ -225,6 +231,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_str, smbus_child_location_str),