mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
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
This commit is contained in:
parent
51f8ac224f
commit
e05436d577
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue