From nobody Sun Dec 01 04:57:45 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 4Y1F614tdlz5gDFX; Sun, 01 Dec 2024 04:57:45 +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 4Y1F612Xq1z4CRJ; Sun, 1 Dec 2024 04:57:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733029065; 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=ukUL6Rj8HSLh98ZZYXj3Dfwxz6khwIJDTQn/Vlfw+g4=; b=NZzXxBhEWxnMy+gafaedfci1HcpkaFcoVwYdjS998nI2kEAK4W59NDdQqTC9DIHSt/7eKm 2UkUbi7WyIg5epAL0A2M93hhfOe/QH12xJhyZfMPzLBojCSsVr1c8yCPSE+CI2VL4jBMZA UOsRJbn14Q2QFiGz04ancfZ93gf2Go9/buRD42AX/OYoUfPztVJjdGZalYEkT3OI4VeKw2 2gNuiUdPTGm7iBSC5Xx4ofmf//BhRZgeZHXfL3u+KgRkFc/bcpUkRcXOjhSN6s+qeE0HoN 7j994cxzHe4TZnesb5nbp2xC2raorTD9wdhLGqcG9NtbDvXWwOddX1qwzDWhRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733029065; 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=ukUL6Rj8HSLh98ZZYXj3Dfwxz6khwIJDTQn/Vlfw+g4=; b=LG77W8b5LBVZmTmdjk5SsT5aTUZIPzsz8t9bjr/E+C8/sVNEo17hmJUQxwxSEsRMI9/X/B k8oxgOZCd3S/AWecXKVuvQTItvzokcNA8gm9Mnam32eEDy8hGdHnUaPL8bJBNytV8ps/C3 sv60cOH/R337h68k/kkxTcIJBKnuRJiUUmakVsrVoNf4N8t6kQf3sXmlKGwwKgu97LHJa4 W0nBGVA81ijajHszNc5ocwbECV4Z5/3jOP0l76qJdhsld80HGtldwIARXyFhzREPPPxI07 ozw14u/9W02NhtWn0AaXmpCEkXrjuQbF7K+JPmnSDyn31NCX9z/ujRftsy/jIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733029065; a=rsa-sha256; cv=none; b=IsW0OZDZRk4Mtc6tg16MB3rm8QWNOKezBjUPMqG4zPv0D8zLjFPPYbl5/L3xp26FZqA6nm STB15XGRBbVQajQ+3KR77M9qtPlzkXiurR1X8IVNBhbMnYSTSFcSg3XTDJQfzMWBSWIg4G QuYJOkedME4nFG8deq2vmVwlJ2r8egylDTc41eL7auyjgSZ2Qc/dZCr39v8+lildSTj67C +eAzsHN8sxQN5+cN+17r0CfQibfUGCY6aiRZIZ/GLHiIhZ0WSWj/pDM4vVCexyJw9ojx+W bMDT8YjSgD1TnY+NXSJ2OGRIVFxPhIB42iDsbUONPUjU/mWH0aUbXFjvEtvbeQ== 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 4Y1F611d1lzfQw; Sun, 1 Dec 2024 04:57:45 +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 4B14vj9D096837; Sun, 1 Dec 2024 04:57:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B14vjER096834; Sun, 1 Dec 2024 04:57:45 GMT (envelope-from git) Date: Sun, 1 Dec 2024 04:57:45 GMT Message-Id: <202412010457.4B14vjER096834@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: 304744faa13b - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 304744faa13b521ce2de5f7817895867d4d11264 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=304744faa13b521ce2de5f7817895867d4d11264 commit 304744faa13b521ce2de5f7817895867d4d11264 Author: John Baldwin AuthorDate: 2024-10-16 18:08:35 +0000 Commit: John Baldwin CommitDate: 2024-11-30 21:33:07 +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 5e76bbeee2bb..1f490850579e 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -3036,6 +3036,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 (!(dev->flags & DF_FIXEDCLASS)) devclass_delete_device(dev->devclass, dev); (void)device_set_driver(dev, NULL);