aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/boot/compressed/eboot.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
index f4bdab1dbf66..ed8e06c59a4c 100644
--- a/arch/x86/boot/compressed/eboot.c
+++ b/arch/x86/boot/compressed/eboot.c
@@ -323,8 +323,10 @@ __setup_efi_pci32(efi_pci_io_protocol_32 *pci, struct pci_setup_rom **__rom)
323 size = pci->romsize + sizeof(*rom); 323 size = pci->romsize + sizeof(*rom);
324 324
325 status = efi_call_early(allocate_pool, EFI_LOADER_DATA, size, &rom); 325 status = efi_call_early(allocate_pool, EFI_LOADER_DATA, size, &rom);
326 if (status != EFI_SUCCESS) 326 if (status != EFI_SUCCESS) {
327 efi_printk(sys_table, "Failed to alloc mem for rom\n");
327 return status; 328 return status;
329 }
328 330
329 memset(rom, 0, sizeof(*rom)); 331 memset(rom, 0, sizeof(*rom));
330 332
@@ -337,14 +339,18 @@ __setup_efi_pci32(efi_pci_io_protocol_32 *pci, struct pci_setup_rom **__rom)
337 status = efi_early->call(pci->pci.read, pci, EfiPciIoWidthUint16, 339 status = efi_early->call(pci->pci.read, pci, EfiPciIoWidthUint16,
338 PCI_VENDOR_ID, 1, &(rom->vendor)); 340 PCI_VENDOR_ID, 1, &(rom->vendor));
339 341
340 if (status != EFI_SUCCESS) 342 if (status != EFI_SUCCESS) {
343 efi_printk(sys_table, "Failed to read rom->vendor\n");
341 goto free_struct; 344 goto free_struct;
345 }
342 346
343 status = efi_early->call(pci->pci.read, pci, EfiPciIoWidthUint16, 347 status = efi_early->call(pci->pci.read, pci, EfiPciIoWidthUint16,
344 PCI_DEVICE_ID, 1, &(rom->devid)); 348 PCI_DEVICE_ID, 1, &(rom->devid));
345 349
346 if (status != EFI_SUCCESS) 350 if (status != EFI_SUCCESS) {
351 efi_printk(sys_table, "Failed to read rom->devid\n");
347 goto free_struct; 352 goto free_struct;
353 }
348 354
349 status = efi_early->call(pci->get_location, pci, &(rom->segment), 355 status = efi_early->call(pci->get_location, pci, &(rom->segment),
350 &(rom->bus), &(rom->device), &(rom->function)); 356 &(rom->bus), &(rom->device), &(rom->function));
@@ -427,8 +433,10 @@ __setup_efi_pci64(efi_pci_io_protocol_64 *pci, struct pci_setup_rom **__rom)
427 size = pci->romsize + sizeof(*rom); 433 size = pci->romsize + sizeof(*rom);
428 434
429 status = efi_call_early(allocate_pool, EFI_LOADER_DATA, size, &rom); 435 status = efi_call_early(allocate_pool, EFI_LOADER_DATA, size, &rom);
430 if (status != EFI_SUCCESS) 436 if (status != EFI_SUCCESS) {
437 efi_printk(sys_table, "Failed to alloc mem for rom\n");
431 return status; 438 return status;
439 }
432 440
433 rom->data.type = SETUP_PCI; 441 rom->data.type = SETUP_PCI;
434 rom->data.len = size - sizeof(struct setup_data); 442 rom->data.len = size - sizeof(struct setup_data);
@@ -439,14 +447,18 @@ __setup_efi_pci64(efi_pci_io_protocol_64 *pci, struct pci_setup_rom **__rom)
439 status = efi_early->call(pci->pci.read, pci, EfiPciIoWidthUint16, 447 status = efi_early->call(pci->pci.read, pci, EfiPciIoWidthUint16,
440 PCI_VENDOR_ID, 1, &(rom->vendor)); 448 PCI_VENDOR_ID, 1, &(rom->vendor));
441 449
442 if (status != EFI_SUCCESS) 450 if (status != EFI_SUCCESS) {
451 efi_printk(sys_table, "Failed to read rom->vendor\n");
443 goto free_struct; 452 goto free_struct;
453 }
444 454
445 status = efi_early->call(pci->pci.read, pci, EfiPciIoWidthUint16, 455 status = efi_early->call(pci->pci.read, pci, EfiPciIoWidthUint16,
446 PCI_DEVICE_ID, 1, &(rom->devid)); 456 PCI_DEVICE_ID, 1, &(rom->devid));
447 457
448 if (status != EFI_SUCCESS) 458 if (status != EFI_SUCCESS) {
459 efi_printk(sys_table, "Failed to read rom->devid\n");
449 goto free_struct; 460 goto free_struct;
461 }
450 462
451 status = efi_early->call(pci->get_location, pci, &(rom->segment), 463 status = efi_early->call(pci->get_location, pci, &(rom->segment),
452 &(rom->bus), &(rom->device), &(rom->function)); 464 &(rom->bus), &(rom->device), &(rom->function));
@@ -526,8 +538,10 @@ static efi_status_t setup_efi_pci(struct boot_params *params)
526 EFI_LOADER_DATA, 538 EFI_LOADER_DATA,
527 size, (void **)&pci_handle); 539 size, (void **)&pci_handle);
528 540
529 if (status != EFI_SUCCESS) 541 if (status != EFI_SUCCESS) {
542 efi_printk(sys_table, "Failed to alloc mem for pci_handle\n");
530 return status; 543 return status;
544 }
531 545
532 status = efi_call_early(locate_handle, 546 status = efi_call_early(locate_handle,
533 EFI_LOCATE_BY_PROTOCOL, &pci_proto, 547 EFI_LOCATE_BY_PROTOCOL, &pci_proto,