mirror of
https://github.com/opnsense/src.git
synced 2026-06-04 14:26:03 -04: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
(cherry picked from commit e05436d577)
This commit is contained in:
parent
13926bcb97
commit
cfb8cc9c5f
1 changed files with 2 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue