From nobody Mon Apr 08 20:25:54 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 4VD0wL4qFNz5HhwW; Mon, 8 Apr 2024 20:25:54 +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 4VD0wL1XYWz3xgk; Mon, 8 Apr 2024 20:25:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712607954; 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=cQLAfb5C8ne5R4wC+ZTnTL2cXUdaWmqPixQ44fQvEIo=; b=yNggGLgP+WQFx6JD/bR/DJ95sNuR9yRcTglLM9LweFKU5fc0Y2XCH+6+w3ucG1RNNdBg9T S6JuJ4wVdZ2oGRHusT3cGSrij+fDFOd2Z/igcSjZ2T5k68r1qFt1AhIYabBCn2GAqnfbDh 1y4zDwCTAxbrzxCjm5RF8HBh/Qr7TV7URJ/yWfEgYyz3f1QoJqe0BFy9j9+FzsQeVCqbNK 6xRMMa5FXCffiDhy3OMaLaTRzy0/FssQzEJxZkRalMFV3+UWMT+Pj/PJ+sRlf4le2ltPAB U9EgaNteEIJC8IeozNKEA0X9C0zotxQ4r/qELo1cqox9AMIHbVkw5KqQGgfPsw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712607954; a=rsa-sha256; cv=none; b=bEBx6QbR5MshfHi/pZ9pUl1UeOarM995ehiQAMYUS0Q7rjxTlFLWXiz6kSOZqC357xMesv sGsLeTA1swPZg4zAH4PVw0anYedy0WeGv2VbZEzC20a6TLXP5GccCkSLrv7/0nbqyj5ABW tK6ub3cxUqY4JJmejkEYj6rtDwturoUXF7s3iHWr9SgJggSNMvGVPGQQCkO0P/1u4dRi32 FCM9Bfqzr2UwQuPv/Mt6gNFKQ5j8wwjb+mgvZ1yzjAbBhqRA9QZ3hAWcTFbt1mb2xNl30X dCYjUnZHbuDtml4HP3pm15TLwxJUeMxfvSAPehMGdvus5YAn78MceAv/9J5h9w== 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=1712607954; 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=cQLAfb5C8ne5R4wC+ZTnTL2cXUdaWmqPixQ44fQvEIo=; b=nB+CoI0Ooe/ihNxaJqlLh39Cuc2F1OdiNjWOzEq04WpZrqMcQiEy1eNbt4FxOviOz/6s+/ yyVq/3vbKYLuxhsq+YFUp2/oA/wx/m5RAhErxlcQL0vg30gCdC3fOy2xn4gTXv7KsGV1gV JUYN0PPHGfucuiqrki/OKYocGlgmF8anpi24ZiTJOu7pS2qQTaAZS9tE5Run0Z6WsoLB71 wEGXknJSTyj+c60qwREuTtzt4QTfVjIm/uliuLohXFIvr/SmhHf7Ul9n0mAO2kKNZ/jJTm I2ycybp6qPLLkc/hUWwF9wrVVfY36JyQRsn59v5O9lzDiusfu6cVX8o9D/06ag== 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 4VD0wL0yGvzQRx; Mon, 8 Apr 2024 20:25:54 +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 438KPsx5040057; Mon, 8 Apr 2024 20:25:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438KPsIp040054; Mon, 8 Apr 2024 20:25:54 GMT (envelope-from git) Date: Mon, 8 Apr 2024 20:25:54 GMT Message-Id: <202404082025.438KPsIp040054@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: 7204a656fcfa - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 7204a656fcfab41200a0056bb5dba0c538d93052 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7204a656fcfab41200a0056bb5dba0c538d93052 commit 7204a656fcfab41200a0056bb5dba0c538d93052 Author: John Baldwin AuthorDate: 2024-02-14 22:07:32 +0000 Commit: John Baldwin CommitDate: 2024-04-08 17:56:03 +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 c4b87e39ce41..1706938e49a3 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -1534,7 +1534,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); }