From nobody Sun Dec 01 04:57:15 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 4Y1F5S2BRBz5gD8M; Sun, 01 Dec 2024 04:57:16 +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 4Y1F5R5hLVz49WP; Sun, 1 Dec 2024 04:57:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733029035; 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=x4Zeec0Y8hTD1EMDb5HWgrFp7By3pejv8y7k/e8V8js=; b=CxEk8FHzhK0dci2JHNWcA2pBMsvwUbbSFmkQ0ZEg9D+T3NpkumrLt+++gl4+xWNgvpXgZM 72n5GuKhxdF0ZBzeEw+g34oSPKhST5zR9e4RpC0qI96WFFzkmn4gSYW9twRahEMA12RFwj TaCFyEa/bRW4DuQVOQkgSadgn9IxeHaZELKUIWXLMmFEMV/UoD4zpIjUVFon7Ka6wOjfa3 R9xTu33MKWj8KIE6sTcSpQh4P9AtluVl+JrML2Eeh9TOEbMuJEoxIOLiY7KpdwZbDfXBXW 4ex6wfmPBeSjmTlijHXtXxWx3PNjye/OvaWQi6pN72yuxzJoOL6lI49dM4gpuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733029035; 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=x4Zeec0Y8hTD1EMDb5HWgrFp7By3pejv8y7k/e8V8js=; b=gnB1UoVMMcw/WkSwh8bzLrXeMbSWuwJFU6pXzz8n3VxJGGGRGPdu264JC7W4YPH/lrYx00 WKzGRfn/05+PdBjqJuJHinvgnr3JN/kJWnZ6t28tMKJQWtScyk5GMG6DOCI7AOj6GQ3wKp TIXTb7fshw3W6wlM00HL8xzvm9zf41qJ1TG/OoOSP25jPRIqN2q7PrVZqJTv+oUi9bJlm/ Ddc9qMnm9KYL+KHz834US9KOUcFPo6CtGawC5ifdLyYjUuDXH5GR9Bl65Bvqgt9J7AQnPE 6eNmU9jtlOsk8j07KcFe/4ppyWXdXWPZINqVVanxf4PkwFhVtWxu1S7b7RuvkA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733029035; a=rsa-sha256; cv=none; b=g3fSoKnJ6fySe5ICmFcECUCiXvpJVNrvRRvd41XqL84yTkbSaiJsG0y4EwwDin3LsaL9SC 6tI7TX7UtkyHYVmuiLlrOKbdxp1QskKoZOvBJ9eO+xSqmi3GQqqFMqK0foqQcn1XYHBVt6 xxjzGPu/fVreljtiL7Fae0SUeu5bioGXdgt99X62RmR4qW2x95pQrw7p5KFvGqBiL7rE9O pGUIUMwzePmHNxG49zKf5YYltQxBGD415M8s5ba4j/YQ6tq4Vowkc8hHXyx8+vAvKVO4fx cZxWdPQb6Mm5eVwwnoKr3QeynjtWCx3koZxQ9EMg/i84dYAMAYwiMuYBqarf1w== 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 4Y1F5R5JpJzfLJ; Sun, 1 Dec 2024 04:57:15 +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 4B14vFLU095437; Sun, 1 Dec 2024 04:57:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B14vFoJ095434; Sun, 1 Dec 2024 04:57:15 GMT (envelope-from git) Date: Sun, 1 Dec 2024 04:57:15 GMT Message-Id: <202412010457.4B14vFoJ095434@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: af26e45173a1 - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: af26e45173a170f6c02f5757a15890b320aae251 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=af26e45173a170f6c02f5757a15890b320aae251 commit af26e45173a170f6c02f5757a15890b320aae251 Author: John Baldwin AuthorDate: 2024-11-01 14:09:50 +0000 Commit: John Baldwin CommitDate: 2024-12-01 02:46:06 +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 33fb5c875c50..f48338865e0a 100644 --- a/sys/dev/iicbus/iicbus.c +++ b/sys/dev/iicbus/iicbus.c @@ -248,6 +248,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) { @@ -360,6 +372,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),