From nobody Wed Oct 16 18:09:17 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 4XTJrZ10Hhz5YqN5; Wed, 16 Oct 2024 18:09:18 +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 4XTJrY6Dkvz4r4m; Wed, 16 Oct 2024 18:09:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729102157; 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=8FOnZrnieeaoMrbQY55VcDBCUkgY0AQHkiMkJp8RBqo=; b=VT6SYgPZwwrcBol2cfVcVdAx8ZVTNtKYgl4zKs4Z8vYCi1A6MysXIr3+IKp3eJAZoidEtI uFmM69KcS1JFdhnYUprfK7jQXfCqkGda/IOTUlF3ZshaimLq3pHGE76jyI8uVuRYqHU3l0 5zVMlSKkPHa+pvlLWEYTBF4DI5NkJfGPwGaamLKCu6DE2GlNbLzcEYnqk1I0gsxtEDaOd4 F1g3cqDUQQ6iHPbVrQNLMxQ3qSKAfOytVj02Ac+Z8rSmIgX/viIispmV9CfHnTLIcmaOuh hcaLL4zP42/mZV2RxPI1XSMqGmvYQB0FSgtjdVeoLg5lyeyBhDMUDtTzZh4UOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729102157; 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=8FOnZrnieeaoMrbQY55VcDBCUkgY0AQHkiMkJp8RBqo=; b=our+2pynFBgKbVPXEo6taoUDMoHIOxwQhJm68ZDdO3nqWB6SUkRA6kSAj+G8PVy1N3o+vn J8SMIOhxrnfDrlGgXiuN9dd3p/Dqh8CTDwkk/k+VcubBBVOMQt52GcCZBwZYTwytWNfaIy sdYgfzrxGq8trBRYZKc2PuhwLqLoXE1EwhwbM+dVoFngYJ3dBfrkRfSML4QI2xwRdLBTgI yql6nadsEIjxOgqMaEocMHA0AfU7NToW8MObND4AAeH6/qQH9iMs8lAp22cAuMHBiKdAQW g0Dwp83FXxgVbn2+xJpqOQCvC8HU9c4CAc5WUdo5aKMBxQj3+wNRXxVjIUIpwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729102157; a=rsa-sha256; cv=none; b=O+dybtDFxH5YPULWT65D7m2lfLr+UZ0Aq9L/8Rt9I0jFH5fuRR56gz/kJPcQmC7hao8LTg +brsPF531LZ6g3UA1EqQN7wtOyiaMY0qhVaLFZTszCJJuCFsghqrjmcnHoR+RiJIcOCBKW ZmXBSD6d4e8KLrh+8pYypyD48uyqhuxHfOC0EP/ti5FxPOI1PQj8pv4tzjy1CDiDrtRG4V CKiIx0YaH8Li//Hkq4HoQC6BJJmpZDM2SQmUuDboqI+SkhSjhgMYe2ojzy6nfWnLVCLR0q sUN5XT1jYlSfB3ZwWF2BZ+zHP93FhNP8F0comcjnSL2xrfqlMeRPuqLci4nDiA== 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 4XTJrY54WWzGgr; Wed, 16 Oct 2024 18:09:17 +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 49GI9H38046357; Wed, 16 Oct 2024 18:09:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49GI9Hfk046354; Wed, 16 Oct 2024 18:09:17 GMT (envelope-from git) Date: Wed, 16 Oct 2024 18:09:17 GMT Message-Id: <202410161809.49GI9Hfk046354@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: 42078dfb0f72 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 42078dfb0f72edbf83217cc8c997c0a54d951990 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=42078dfb0f72edbf83217cc8c997c0a54d951990 commit 42078dfb0f72edbf83217cc8c997c0a54d951990 Author: John Baldwin AuthorDate: 2024-10-16 18:08:35 +0000 Commit: John Baldwin CommitDate: 2024-10-16 18:08:35 +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 --- 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 f41884d576a8..7140ca007b71 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -2544,6 +2544,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