From nobody Sun Dec 01 04:56:55 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 4Y1F534Klyz5gD5W; Sun, 01 Dec 2024 04:56:55 +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 4Y1F531vL3z47h2; Sun, 1 Dec 2024 04:56:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733029015; 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=6csPBYHFhUoLTvYZwITLQ3Vssspo3Mmvfn0UafBIuQc=; b=J1SjsKu9DHQPLfHMZ1jeA32fYgI2YA74v3z4oZFqJX3u1byB6rs5OArSvf4noYcdMGmr4V t1ewIGk0UEh9XrUvZyzmPiQo4sR7MMeN+GsFpHHmpcpg+xM2QIaxS8I25qs5zGYn2k395Z HFBdMnJLrIgoHgUL+Eyi3MZZEm3a8jpzrtdV6kVGO0f7jkAUQmLvVcmDozns9CBOGyRVW4 1dTAFDhBUF8U5rVsiDcTGFNe6h4Bc0xqcJcq+sudkHL5ny1isumjZtC9I/GliBsSJWbE3c Tq8hoSiLFhvdANtV683idUn5ury9vuSU4bR6yRf4VFXoPxoxcmKMS1D5BRVbyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733029015; 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=6csPBYHFhUoLTvYZwITLQ3Vssspo3Mmvfn0UafBIuQc=; b=L+MoJEjjst1mWGd6jeNacGQRjaPN47nfCQuC2T6qqXlvnoL1BVev6G4qgIVy+HUmZzCse/ 0LL3h2W1Q/4VHpMRPdwM8sTbzqJZ2wIkmhJjKnkDLuq9RCSEUTkUKoTwGBqrf1ehLhF15j RpPa7DyPYRi/elH+e2YVHGQ3crfN8hEobptZ/KGyhw5jIWp2IbCcTURIWu5GGuBq18CCOE 6HDe2yi8fW1++hZ4yUhxAd414qCq3E21PhP99EfdEcpNHBkG3SVltTzkfrZ+E6DdA5tAYW eXu2oikdg7fP1uLkmYnGBa6T3vJmMTcLpRQsS3hJ9fHKj9/Dad1lclfRhzu1zQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733029015; a=rsa-sha256; cv=none; b=U86EUEckogG6YyT0ysYyl/Mowyh6K9RDuZgmawisR/QeOR5ipAMkyF+quzZIDSkNbabp4G lc2SlkYaRX9tbmglV/YCnfG0boVXfddiHgatSUOFHeQhNMpxaYqj2i+WDzOutA/BcDcpNV FV+Bt72ucWE1EJeoZCo+sEXi7OlzGT8scLtT8mZZRhC/u5wj0GjOGBb5HDZEIbuXUpDIQe 8NMssAMstBo8FjBy1z+h8vjjsb5ENt8zmu/T6HxhSjL72FF3WhqCRFRAfDJV8MwpstS+kf py+RPnjam1fb1rnXkkSGfCwfixquR83xye2aUF8vzT0O1zztKzArMOt5yZrO3A== 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 4Y1F531TFQzf7R; Sun, 1 Dec 2024 04:56:55 +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 4B14utbp094442; Sun, 1 Dec 2024 04:56:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B14utnq094439; Sun, 1 Dec 2024 04:56:55 GMT (envelope-from git) Date: Sun, 1 Dec 2024 04:56:55 GMT Message-Id: <202412010456.4B14utnq094439@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: c7ec1fadb52d - stable/14 - device_attach: Invoke BUS_CHILD_DETACHED if an attach routine 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/stable/14 X-Git-Reftype: branch X-Git-Commit: c7ec1fadb52d05c998c8e304ed8085946d971389 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c7ec1fadb52d05c998c8e304ed8085946d971389 commit c7ec1fadb52d05c998c8e304ed8085946d971389 Author: John Baldwin AuthorDate: 2024-10-16 18:08:35 +0000 Commit: John Baldwin CommitDate: 2024-12-01 02:46:04 +0000 device_attach: Invoke BUS_CHILD_DETACHED if an attach routine fails This gives the parent bus driver the opportunity to cleanup any allocated resources, etc. left behind by a failed attach attempt. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47155 (cherry picked from commit 42078dfb0f72edbf83217cc8c997c0a54d951990) --- sys/kern/subr_bus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 982eeaebf21c..d271013b4b1f 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -2597,6 +2597,7 @@ device_attach(device_t dev) if ((error = DEVICE_ATTACH(dev)) != 0) { printf("device_attach: %s%d attach returned %d\n", dev->driver->name, dev->unit, error); + BUS_CHILD_DETACHED(dev->parent, dev); if (disable_failed_devs) { /* * When the user has asked to disable failed devices, we