Ticket #9911: 0021-Fix-dereference-of-a-null-pointer.patch

File 0021-Fix-dereference-of-a-null-pointer.patch, 1.2 KB (added by mt, 11 years ago)

Patch

  • src/add-ons/kernel/bus_managers/pci/arch/x86/pci_acpi.cpp

    From b5a5f71223a8bef034287ec5f432f9581dd6276d Mon Sep 17 00:00:00 2001
    From: Murai Takashi <tmurai01@gmail.com>
    Date: Fri, 2 Aug 2013 20:51:39 +0900
    Subject: [PATCH] Fix dereference of a null pointer
    
    ---
     .../kernel/bus_managers/pci/arch/x86/pci_acpi.cpp  |    7 +++++--
     1 file changed, 5 insertions(+), 2 deletions(-)
    
    diff --git a/src/add-ons/kernel/bus_managers/pci/arch/x86/pci_acpi.cpp b/src/add-ons/kernel/bus_managers/pci/arch/x86/pci_acpi.cpp
    index f1fb0fa..0bc65a1 100644
    a b acpi_check_rsdt(acpi_rsdp* rsdp)  
    117117        rsdtArea = map_physical_memory("rsdt acpi",
    118118            rsdp->rsdt_address, sizeof(acpi_descriptor_header),
    119119            B_ANY_KERNEL_ADDRESS, B_KERNEL_READ_AREA, (void **)&rsdt);
    120         if (rsdt != NULL
    121             && strncmp(rsdt->signature, ACPI_RSDT_SIGNATURE, 4) != 0) {
     120        if (rsdt == NULL) {
     121            TRACE(("acpi: couldn't map rsdt header\n"));
     122            return B_ERROR;
     123        }
     124        if (strncmp(rsdt->signature, ACPI_RSDT_SIGNATURE, 4) != 0) {
    122125            delete_area(rsdtArea);
    123126            rsdt = NULL;
    124127            TRACE(("acpi: invalid root system description table\n"));