mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-19 10:53:58 +00:00
MFp4: When doing lazy allocation, it turns out that we need to record the
actual resource values we received from the system rather than the range we requested. Since we request a range starting at 0, we would record that number. Later, since this == 0, we'd allocate again. However, we wouldn't write the new resource into the BAR. This resulted in a resource leak as well as a BAR that couldn't access the resource at all since rman_get_start, et al, were wrong. MFC After: 1 week (assuming RELENG_6 is open for business)
This commit is contained in:
parent
87623e8dd6
commit
e5baeed6a6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=151847
@ -1749,6 +1749,9 @@ pci_alloc_map(device_t dev, device_t child, int type, int *rid,
|
||||
if (rle == NULL)
|
||||
panic("pci_alloc_map: unexpectedly can't find resource.");
|
||||
rle->res = res;
|
||||
rle->start = rman_get_start(res);
|
||||
rle->end = rman_get_end(res);
|
||||
rle->count = count;
|
||||
if (bootverbose)
|
||||
device_printf(child,
|
||||
"Lazy allocation of %#lx bytes rid %#x type %d at %#lx\n",
|
||||
|
Loading…
Reference in New Issue
Block a user