From d6a7cd2564be7157b3a5edef74d161919884b442 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Mon, 29 Sep 2008 13:13:39 +0000 Subject: [PATCH] Checking the return value of methods is always a good idea. This fixes a KDL I'm getting on start with vmware when including the acpi module in the build. Now, finding why this happens in the first place would be nice. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27777 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/bus_managers/acpi/oshaiku.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/add-ons/kernel/bus_managers/acpi/oshaiku.c b/src/add-ons/kernel/bus_managers/acpi/oshaiku.c index bdeac05d9b..c6aa12686d 100644 --- a/src/add-ons/kernel/bus_managers/acpi/oshaiku.c +++ b/src/add-ons/kernel/bus_managers/acpi/oshaiku.c @@ -509,8 +509,14 @@ AcpiOsMapMemory ( area_id area; void *there; - area = map_physical_memory("acpi_physical_mem_area", map_base, ROUNDUP(length + page_offset,B_PAGE_SIZE),B_ANY_KERNEL_BLOCK_ADDRESS,0,&there); + area = map_physical_memory("acpi_physical_mem_area", map_base, + ROUNDUP(length + page_offset,B_PAGE_SIZE),B_ANY_KERNEL_BLOCK_ADDRESS,0,&there); + if (area < 0) { + dprintf("ACPI: cannot map memory at %p, length %ld\n", map_base, length); + return NULL; + } there += page_offset; + return there; #endif