Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Feb 2024 22:52:42 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: e05436d577de - main - acpi: Don't assume a resource is reserved in acpi_delete_resource
Message-ID:  <202402142252.41EMqgEF086277@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=e05436d577de98944b97b9cf510b29c4d2091b3f

commit e05436d577de98944b97b9cf510b29c4d2091b3f
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2024-02-14 22:07:32 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202402142252.41EMqgEF086277>