From 248594819adec7477e435bca3716ac6c48a39c21 Mon Sep 17 00:00:00 2001
From: Murai Takashi <tmurai01@gmail.com>
Date: Thu, 25 Jul 2013 20:57:34 +0900
Subject: [PATCH] Fix dereference of a null pointer
---
src/system/boot/platform/bios_ia32/acpi.cpp | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/system/boot/platform/bios_ia32/acpi.cpp b/src/system/boot/platform/bios_ia32/acpi.cpp
index d9207fd..d68eb12 100644
a
|
b
|
acpi_check_rsdt(acpi_rsdp* rsdp)
|
122 | 122 | return B_ERROR; |
123 | 123 | } |
124 | 124 | |
125 | | length = rsdt->length; |
126 | | // Map the whole table, not just the header |
127 | | TRACE(("acpi: rsdt length: %lu\n", length)); |
128 | | mmu_free(rsdt, sizeof(acpi_descriptor_header)); |
129 | | rsdt = (acpi_descriptor_header*)mmu_map_physical_memory( |
130 | | rsdp->rsdt_address, length, kDefaultPageFlags); |
| 125 | if (rsdt != NULL) { |
| 126 | length = rsdt->length; |
| 127 | // Map the whole table, not just the header |
| 128 | TRACE(("acpi: rsdt length: %lu\n", length)); |
| 129 | mmu_free(rsdt, sizeof(acpi_descriptor_header)); |
| 130 | rsdt = (acpi_descriptor_header*)mmu_map_physical_memory( |
| 131 | rsdp->rsdt_address, length, kDefaultPageFlags); |
| 132 | } |
131 | 133 | } |
132 | 134 | |
133 | 135 | if (rsdt != NULL) { |