From nobody Mon Apr 08 19:04:34 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 4VCz6V6FlCz5HYWD; Mon, 8 Apr 2024 19:04:34 +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 4VCz6V3Wzjz4gkt; Mon, 8 Apr 2024 19:04:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712603074; 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=YmuAbye1AWhQBD2Bc0R3YJXJM65YIMgQwyeDq4alH3I=; b=AVC62pzWkoDhAtv8UO8pcq4/5jis37EKEhQGDqon9qoTtOxJhsr4O00ybuO/KP+qc+kZUx MrKJEPXWT98hTyODCMrsPYhN0MFEaVspp7z2sRAVLRZ0aqwv46ryAI03W+qAN2fxrXabAf 3uqhOzezpIRxKCweJr3oYZvp0OGEv9a92iJ5wfkv0GadeHTLGQAuMmBGgUosOa7XkQU+cP BJE2Gohv3WjOoNqNUco3JNJySSTv3Jx0oiw594hF8TU8lXJVmutvH0FkTpxblkjtnzsoVe GNKUP++3fogOli/kntiaJ1x0K2USIQ/BKWRSj7K92BtvWdaoIe76MIQtmUXWjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712603074; a=rsa-sha256; cv=none; b=aQVHgPyMMGbzrm5H6WjIubmi8z/aY23GH3Ji9XYbJA08/lMskgS56sf7mnU+8IcuQmuvQC 5EzzxpNkZln+TV09FHs8Xrk4Dx5OTBMfEJohRfrY0nIQNs0k4bLRQ922Jnf4jaxl/PCFjH gGqyGjj4uPyU8sfFcdVMoWlIFlm9i1xvTWXgZYiPDxjRKM+7JzKhA0jFvfXwOBZnp3OVAx Y3hEykCKYi6nXczoTZ/pPzNNjBbTWBoCC/JMyrSSJ+ZKunTmCjxbK8vqEBi0Z8xPhKD56M rw9mdZbGTRIWKLuop4pCw47U1vVlDudx4HhIpqalLqwQuIWkB2FaiTG6xE0kTw== 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=1712603074; 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=YmuAbye1AWhQBD2Bc0R3YJXJM65YIMgQwyeDq4alH3I=; b=daSQDRbCQVE09l1xXumRdA060E4idsIWQc9JJLP+3rUkN2taEZFDDLi4BQAbMTcNTQq+KN kqzIIayZrFZY7nhGtmpcz74dv2GWtgOJgoSXr9uHg0P0ixQPTn1v6Xi+yHFTV/3lMbbLGv Ndgrxqa9Cv+IdrRk4UYeFGAdUHdqvAlUo/ZECnKMSO6nA6gzYc41x5tpXPeGE1ECY06vSo Ze+o31TIoAb2TNuHBrw//Usfmnku1hciNxsoCM195XuwSFdeLWiZaaPgT7TMPA1ot8XzT+ dmwNeHqVMv7AhwoQcz1sCwjevKzQW65aCwnejyls6nz3tL5VlD8M5dktgm0OUg== 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 4VCz6V337qzNQF; Mon, 8 Apr 2024 19:04:34 +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 438J4Y8D094510; Mon, 8 Apr 2024 19:04:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438J4Yns094507; Mon, 8 Apr 2024 19:04:34 GMT (envelope-from git) Date: Mon, 8 Apr 2024 19:04:34 GMT Message-Id: <202404081904.438J4Yns094507@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: cfb8cc9c5fa9 - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: cfb8cc9c5fa942ef51d3738851efd63ba0aeaccd Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=cfb8cc9c5fa942ef51d3738851efd63ba0aeaccd commit cfb8cc9c5fa942ef51d3738851efd63ba0aeaccd Author: John Baldwin AuthorDate: 2024-02-14 22:07:32 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:55:58 +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 (cherry picked from commit e05436d577de98944b97b9cf510b29c4d2091b3f) --- 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 955c2b71b5ec..0894f4464162 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -1619,7 +1619,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); }