From nobody Wed Feb 14 22:52:42 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 4TZtkg1Bm6z53xlh; Wed, 14 Feb 2024 22:52:43 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TZtkf6dHvz4FDj; Wed, 14 Feb 2024 22:52:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707951162; 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=OOp3gwOuNxm97KbOvEkKcNGOzX5kOkyPD1z2TCIp7w0=; b=Y1il0VMsm9VuVcdGAVuGRaFyNSjntH2D61ZHD1mn6YmXwKjYH4nBDtvFKn3PqpukaqFIJZ AQktkvedgjOPURF7vOKo3mNwGipliBVH5IRp46+x4RSRLXdOm23sOS+MzKk9cFo2kkh6X9 ggZCTUj3xMZ7cj05OjhA+Y3Qk6/He0jJYzvydo+uKV1o4R+WisNjqvSo20BsGsRJ9BbygL ld6vuLadR1z/WBbVhD4lzxKMQTRNS6AX1XgFVnp7IKo8khAuQMXfnKahW/jDFjURnfXZ3V ggkt3vD0bGMii5XMRcV9CwWFXEsGQJa5X+vN3AhwVnbnaCmZLLnYf6e31h7UBA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707951162; a=rsa-sha256; cv=none; b=w1gd4CVd5bEnyn/4KzEr/4cl8hertIcpujvd1Q6pjODjByXe1+Ss8XyiDD3TQfnI2XPgD2 d25nZnEhKTyY7VWAJaS1/48/E4Tanvo72tt88IHmqFR8PjugMM0HP1LTovdLoz2U7eh3vK 1EyixsoGuboXAqKbRlh/Toz9gQHl1Fz/BVCXvOSDzEvdJ3g2llRYQEhVCLJrODYepEwMHO rspAD2D7Y/C+7AG0FbH6QDQAnFrOKsY/2cqRJCk8OU/UaXPJkr+0CllM3tyhc3BA8uvc/H RfcB7k2lvYypqE92oN0PMcRJ1TURNPjiIxIIHCrt0s8HUx6H7qWVxfqzG0GfNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707951162; 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=OOp3gwOuNxm97KbOvEkKcNGOzX5kOkyPD1z2TCIp7w0=; b=vcmc8xiT6J1cxBpDosTVO0r/S1faPAXSFt3SU5abI+NDmd8IXNcAKEEtSjcWk1cAjgAsxD A4VKN7p9WJ0m7Y0PK9nOmCGg51ahAj+lcNvm2/3N631AGtQSg2MzwZwMP/wSS6o0KhdIUk YwAFdMJbtBP99rxVR2vizyCA85eA/c+jcaxVN4URHJ1HgMb3hUDJXeS1zwsSlKG6w5v4Ic hq5pLtY/Vqy4U72AjoOzkeKI6FZmwwy/5K63jKTyQjqdV+1nU9R1KP5W8f6LsiOOcyElTr lqtCMxR2ltgan6fDDI9npmAfk/K766+tFykBa5YPvQ1BqN/vM6RbkstVPuvvcA== 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 4TZtkf5lNrzHZm; Wed, 14 Feb 2024 22:52:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41EMqgvB086280; Wed, 14 Feb 2024 22:52:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41EMqgEF086277; Wed, 14 Feb 2024 22:52:42 GMT (envelope-from git) Date: Wed, 14 Feb 2024 22:52:42 GMT Message-Id: <202402142252.41EMqgEF086277@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: e05436d577de - main - acpi: Don't assume a resource is reserved in acpi_delete_resource 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: e05436d577de98944b97b9cf510b29c4d2091b3f Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e05436d577de98944b97b9cf510b29c4d2091b3f commit e05436d577de98944b97b9cf510b29c4d2091b3f Author: John Baldwin AuthorDate: 2024-02-14 22:07:32 +0000 Commit: John Baldwin CommitDate: 2024-02-14 22:07:32 +0000 acpi: Don't assume a resource is reserved in acpi_delete_resource This fixes a panic if a driver uses bus_set_resource to add a resource that fails to reserve and then deletes the resource via bus_delete_resource. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43891 --- sys/dev/acpica/acpi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 9cd809761b8e..46e9fe084fce 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -1629,7 +1629,8 @@ acpi_delete_resource(device_t bus, device_t child, int type, int rid) " (type=%d, rid=%d)\n", type, rid); return; } - resource_list_unreserve(rl, bus, child, type, rid); + if (resource_list_reserved(rl, type, rid)) + resource_list_unreserve(rl, bus, child, type, rid); resource_list_delete(rl, type, rid); }