From nobody Thu Jan 02 18:28:35 2025 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 4YPFZr3Hf2z5jnfw; Thu, 02 Jan 2025 18:28:36 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YPFZr0Fkzz4v5k; Thu, 2 Jan 2025 18:28:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735842516; 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=6sje0G8x4xcn4IcRT+YJtH426m/uquWeB4iHCBq8FAE=; b=JRahxvvjTo1rrcNZkGpr0WXCX8LGRa4B0BKG36QUnLvSvxk4DDgC9MbWGzEaRTFU3k8WAC NX01Kux5UttPXGOWV845WOI/DmHii5ub2r6z12Rm15RVw6roS7LuY1TmuOBXhDnvAbz8ZF +uVwEtrAEXB4aUFmWu4Hx5hPkNw+8gFpbB/rWLBkKyEpl4qUUNJdSZ749a7yEfN/M3zRxB EAZt12C67VKTIkcispLN2HG3NxoqfgnLjnmLQ//vhROhyKItypO3Ny+gOGjMV+6jDb3oFp 89ZoGr2GyjDY7iyvuqm9iDN+2ByXf9W/EIHNkGH2xi6SxRVl6YWYXLKB0Ft83w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735842516; 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=6sje0G8x4xcn4IcRT+YJtH426m/uquWeB4iHCBq8FAE=; b=RY7vx3o2b+/ZOrtH+E9y0eK05EKjl+bzNrBeyNqWQhfoJMZ7phJ2wZKdU4xtTsZHpKVJ3a f6TzyBklEiQXYUqMS/3Mj/TIZauHczCD0wmds7nMXlHPenzqwt4v1hZVz8sIf8v6Ssdw2k MxHnwl03zImPMqKCWds45P1NRwoQIMnlyb0KgqvO0VFa+NBKt2pET73fL/NeUfFcbWbyMX tgLttSLplOIG+JvHOUIg4UZE/pIHGDd29Kk3WvDYAFiwcg5xPkGzsynu5hOcKB89nJzjp1 oL0xKKlCcaWWOyv2gQo49b8Pd7ev1PmAyNqTUgbMgtTayJpppSWFLCXfdFNTdQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1735842516; a=rsa-sha256; cv=none; b=xcnpyvD0cymCdftKvwwE/erZWowh2RTKjZCYIh++F2Xh+EnhlEvzgJmzjmuHuorZz4sN+6 RRVU6ym0OnCtWQ/S52Qlll3vpS+EjjbPXPZWV1TIdT5TDokiBojrDRkXlpU4rhG1V2IIkC qZLVqH9pDSfJ99psQ3QgNuQaqPmqb77aRosusxWF6RuQxwpCzzfrGLqGvhL0BTQQtUowry 0lKBAlEmUjjbTotUGn3DVkvaCZUajqD1JRqV2UL+CGLwsKPbShKYtqUNcnU3VMXNObodxb C0yEpu//y0S340QpPfaKm+MQCF52+BquHvT3fpvdKdlgaSK8lAsWb07JeaJhxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4YPFZq6yxpzp5B; Thu, 02 Jan 2025 18:28:35 +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 502ISZfD066906; Thu, 2 Jan 2025 18:28:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 502ISZNJ066903; Thu, 2 Jan 2025 18:28:35 GMT (envelope-from git) Date: Thu, 2 Jan 2025 18:28:35 GMT Message-Id: <202501021828.502ISZNJ066903@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: 925e1016b163 - main - puc: Use device_delete_children if attach fails 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: 925e1016b163701268a4298d1eca4b2484a81526 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=925e1016b163701268a4298d1eca4b2484a81526 commit 925e1016b163701268a4298d1eca4b2484a81526 Author: John Baldwin AuthorDate: 2025-01-02 18:25:38 +0000 Commit: John Baldwin CommitDate: 2025-01-02 18:25:38 +0000 puc: Use device_delete_children if attach fails This is slightly simpler than deleting individual devices. Differential Revision: https://reviews.freebsd.org/D47974 --- sys/dev/puc/puc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/puc/puc.c b/sys/dev/puc/puc.c index e10d0374c7de..d55fdf63e70b 100644 --- a/sys/dev/puc/puc.c +++ b/sys/dev/puc/puc.c @@ -373,10 +373,9 @@ puc_bfe_attach(device_t dev) return (0); fail: + device_delete_children(dev); for (idx = 0; idx < sc->sc_nports; idx++) { port = &sc->sc_port[idx]; - if (port->p_dev != NULL) - device_delete_child(dev, port->p_dev); if (port->p_rres != NULL) rman_release_resource(port->p_rres); if (port->p_ires != NULL)