Fix dereference of a null pointer

Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
This commit is contained in:
Murai Takashi 2013-08-02 20:51:39 +09:00 committed by Jérôme Duval
parent ce2d7d5ac8
commit 004a268e04

View File

@ -117,8 +117,11 @@ acpi_check_rsdt(acpi_rsdp* rsdp)
rsdtArea = map_physical_memory("rsdt acpi",
rsdp->rsdt_address, sizeof(acpi_descriptor_header),
B_ANY_KERNEL_ADDRESS, B_KERNEL_READ_AREA, (void **)&rsdt);
if (rsdt != NULL
&& strncmp(rsdt->signature, ACPI_RSDT_SIGNATURE, 4) != 0) {
if (rsdt == NULL) {
TRACE(("acpi: couldn't map rsdt header\n"));
return B_ERROR;
}
if (strncmp(rsdt->signature, ACPI_RSDT_SIGNATURE, 4) != 0) {
delete_area(rsdtArea);
rsdt = NULL;
TRACE(("acpi: invalid root system description table\n"));