From nobody Sun Dec 01 04:58:04 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 4Y1F6N71qRz5gD44; Sun, 01 Dec 2024 04:58:04 +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 4Y1F6N56Ryz4CvK; Sun, 1 Dec 2024 04:58:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733029084; 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=qG0gVHEWD+hOSYtLN6TDIsKvq5NT18Y2WhxvsJhD3Gg=; b=wd674V+issbTxvEiDXdWbtZVViLR2HKR3Id07Iy2bYHxsZN2tKdJlT4jfY45CY5e93MIM+ vdNTX+gVZ+u3pVaSPDgUKv6JGkPsh54NBJNGP7VoEAqW2QhUQlLHSAad/rs4HS3wOju6pK LxFJDmTqjkRcZqsqXYLF5smVfsK5lQQQZ9dR8qrRq+lGCJ6fwkWVW2jEqDvGqgIQRyaz50 TZRxngYpIQS80IkDhbbp/StG9gAgSIoVn27pXbSN+RwIJI4DkvbrZOEKu6dE/FkXbiSw5u iN2296XS3lc2ja5WvXLEYRJ7u9X3n41nPogmWGz91IEK/I0jpSR24lvrtzIqAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733029084; 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=qG0gVHEWD+hOSYtLN6TDIsKvq5NT18Y2WhxvsJhD3Gg=; b=G5FZdOedh689jF4CMuDSFInrX+V6nNeJZcku6ddS7cI8YdvemdDM5kp9OH9u1FSeEsZoVJ cPled3cHMEASS2HtyjOXbepONKHntZkudFdmtlTLwwX+rqkslamG5udjvQ/971PlJOFqoc 63UjMIDQ3x7zpgfR/FETiEydyyJkA4hMUUAChdGbHsx56Yf5sPp1u53w+KyR7ZfYBmo/9O 2yAIxEXK/AWhw95rhjoLfTje6jLgXvMFJwt0DbNbzoyUJj2A3msI6OxUmzY7/4vxmXJHgj L2cvF2RpIvLJlIAUlEmDdfJLP9lxykWIBTUgEZK3dt58YPfroHBtDvE/BWESTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733029084; a=rsa-sha256; cv=none; b=ZjW3FnQ0BoLYbjrW5p1ZtJMQ3kyYH+EQYWXF61orbXH0+DZqibIW4Kc5P3lxvGrLsgpeLr uYkBbS1VMBvMQiwD5+78WBsCV/3SG4/p0Ykjs6bMcaS68k5KzGNokVJr/1D9iccKkTpB/F x23DzofZ18H72LR9BuVQinZFvAZ0SnS3IctnFcsltYr4TXuE3TWrCy4NhxHHq0t4ubQOHv Ex33Cq3HorOtcEa30LnWDx62hdmZ5uLplsSrE+aqriyryjIkpcaKICwP5yu4W57oLXOadb wjxWUFtLCFN5HWfE62ZqVq2gASbGCKELC7QqszywhsYCUv8HxPSPxsoio0rOtg== 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 4Y1F6N4f24zf7Y; Sun, 1 Dec 2024 04:58:04 +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 4B14w4im097792; Sun, 1 Dec 2024 04:58:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B14w4Bw097789; Sun, 1 Dec 2024 04:58:04 GMT (envelope-from git) Date: Sun, 1 Dec 2024 04:58:04 GMT Message-Id: <202412010458.4B14w4Bw097789@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: de7568362a93 - stable/13 - iicbus: 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: de7568362a936fb39e393f72e0ed002bc29521d1 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=de7568362a936fb39e393f72e0ed002bc29521d1 commit de7568362a936fb39e393f72e0ed002bc29521d1 Author: John Baldwin AuthorDate: 2024-11-01 14:09:50 +0000 Commit: John Baldwin CommitDate: 2024-11-30 21:44:03 +0000 iicbus: Use a bus_child_deleted method to free ivars for children Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47370 (cherry picked from commit 9c99ba9a0677a7b5c3c578c430211dafb4ad0dd5) --- sys/dev/iicbus/iicbus.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sys/dev/iicbus/iicbus.c b/sys/dev/iicbus/iicbus.c index 223a7885cbb9..ce249982f6eb 100644 --- a/sys/dev/iicbus/iicbus.c +++ b/sys/dev/iicbus/iicbus.c @@ -250,6 +250,18 @@ iicbus_add_child(device_t dev, u_int order, const char *name, int unit) dev, order, name, unit, sizeof(struct iicbus_ivar))); } +static void +iicbus_child_deleted(device_t dev, device_t child) +{ + struct iicbus_ivar *devi; + + devi = device_get_ivars(child); + if (devi == NULL) + return; + resource_list_free(&devi->rl); + free(devi, M_DEVBUF); +} + static void iicbus_hinted_child(device_t bus, const char *dname, int dunit) { @@ -362,6 +374,7 @@ static device_method_t iicbus_methods[] = { DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), DEVMETHOD(bus_get_resource_list, iicbus_get_resource_list), DEVMETHOD(bus_add_child, iicbus_add_child), + DEVMETHOD(bus_child_deleted, iicbus_child_deleted), DEVMETHOD(bus_print_child, iicbus_print_child), DEVMETHOD(bus_probe_nomatch, iicbus_probe_nomatch), DEVMETHOD(bus_read_ivar, iicbus_read_ivar),