From nobody Sun Dec 01 04:57:17 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 4Y1F5V2tZpz5gD8S; Sun, 01 Dec 2024 04:57:18 +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 4Y1F5V0HPqz49V1; Sun, 1 Dec 2024 04:57:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733029038; 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=TjVn6gm64HatXWc8RMVw2SGNxaaA5J6+IpSrp6LD3l4=; b=c+QJpQF84mQPY4LWXMDdhTWtinH2gwUibUiSaRGS0TunrONOObUHvRnDTauJEJq/Rs2kNd vrJGvzsaFMe/wecdCvyRdMammQ++oe7ZLSaCGOIl/9elyNuCSbmWiZbxdKxI0kvUIefXhm Z0RoGyNgk43rMtY7YhOxTes0M/daaM40HP2fV33uvFCcEuVDjDnNG1YjMAHJ0uwdiIpePc DEZiBNKYTcA31KstYTE3pYMS8hSpoVhwQZ/jCS+SsOzmr99uhv4Uy6jmAJX62asloqqNWb rvlbA7VCjBv0yE/NOKTBmvxLoVtkYcHMot1C523Z9YU0OvOzXiCBhnX//cX0Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733029038; 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=TjVn6gm64HatXWc8RMVw2SGNxaaA5J6+IpSrp6LD3l4=; b=hjG2uovRFSQWeqY1kYuPjKs8FYhdqaIFChH2LuF+Af/sE2jyuUfnqPPg1YLHnlWTEQXahm 44PbzRCQLSBU7wO4OvnUKlgW/6wKlwjeKQgzrMqrc7wzT7WykD2Day8ZDpPI6P0ZjUzDmL ghcNVXHdr0PNyztc19WI/ogKAktKbM+wgWGiNmEL7lWybsgqkpu0RbDQwFneIe4aeqr09A f0QUg8uw0fO1dApH16Hfw4pO76/smfu/K9z7MMQ32fi6oeqMgT0Wv2Dm8EQa79W9NstNjH oWawV7wLRn8Izz65JVCguDkvBh+WOb3VOXiSQOXAj91lic6W2l4FtDksRxhMDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733029038; a=rsa-sha256; cv=none; b=pTRUy5ajvHUzhiul2ahS+/aLPDjeaH/umEPRyPz+8y17WIVo2oN/h2P8SmR9uFsQ7RwEqw OygP3IRcg7FPIjqLDwRg/xcve/kxuxPpunbr2Wsh4b/cK/3GoCBSfGS4EXudOPjkOi5efh yze+MX9Lk7d0hWXcWIJDX6JtbX/ehi7JGmwr7GRuO9mw/rXyYkQN8h7MBWAjcoq18Yvq9Y vFZTUQg/8k1wQBoVhYfvsPEaPXkfGuqFm0QXtynNs4JJLhV1quaxpV7L59AmXDGUY0Wp3v shTgubCQN6VN3Xi6C0fuGWUIofrxpByDemv6nzc/q9YuI5ElcSISNcDe+ouspQ== 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 4Y1F5T715QzfQt; Sun, 1 Dec 2024 04:57:17 +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 4B14vHMg095559; Sun, 1 Dec 2024 04:57:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B14vHs8095556; Sun, 1 Dec 2024 04:57:17 GMT (envelope-from git) Date: Sun, 1 Dec 2024 04:57:17 GMT Message-Id: <202412010457.4B14vHs8095556@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: 87bb96bb4788 - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: 87bb96bb4788cc33c1a9b19671bdd0884acc5152 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=87bb96bb4788cc33c1a9b19671bdd0884acc5152 commit 87bb96bb4788cc33c1a9b19671bdd0884acc5152 Author: John Baldwin AuthorDate: 2024-11-01 14:10:10 +0000 Commit: John Baldwin CommitDate: 2024-12-01 02:46:07 +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 074530081049..3d0f5fe65464 100644 --- a/sys/dev/smbus/smbus.c +++ b/sys/dev/smbus/smbus.c @@ -113,6 +113,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) { @@ -223,6 +229,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),