soc/amd/common/block/graphics: Add missing pci_rom_free()
pci_rom_probe() can allocate memory when mapping a CBFS file, so pci_rom_free() should be called before leaving the function. BUG=b:278264488 TEST=Build and run with additional debug prints added to confirm that data are correctly unmapped Change-Id: Ie6fbbfd36f0974551befef4d08423a8148e151e7 Signed-off-by: Grzegorz Bernacki <bernacki@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/74779 Reviewed-by: Karthik Ramasubramanian <kramasub@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Himanshu Sahdev <himanshu.sahdev@intel.com>
This commit is contained in:
parent
e6b4597fef
commit
4aa31ac3f9
|
@ -157,11 +157,21 @@ static void graphics_set_resources(struct device *const dev)
|
|||
return;
|
||||
}
|
||||
rom = pci_rom_probe(dev);
|
||||
if (rom == NULL)
|
||||
if (rom == NULL) {
|
||||
printk(BIOS_ERR, "%s: Unable to find ROM for %s\n",
|
||||
__func__, dev_path(dev));
|
||||
timestamp_add_now(TS_OPROM_COPY_END);
|
||||
return;
|
||||
}
|
||||
|
||||
ram = pci_rom_load(dev, rom);
|
||||
if (ram == NULL)
|
||||
return;
|
||||
if (ram == NULL) {
|
||||
printk(BIOS_ERR, "%s: Unable to load ROM for %s\n",
|
||||
__func__, dev_path(dev));
|
||||
}
|
||||
|
||||
pci_rom_free(rom);
|
||||
|
||||
timestamp_add_now(TS_OPROM_COPY_END);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue