Skip to content

Commit 6454c7b

Browse files
JasonChenCJjren1
authored andcommitted
mmu: refine function map_mem_region
function map_mem_region should return mapped_size, if something wrong, it return 0. the change is valid for release version, as at that time ASSERT() in map_mem_region is empty. Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent fa3e424 commit 6454c7b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

hypervisor/arch/x86/mmu.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ static uint32_t map_mem_region(void *vaddr, void *paddr,
173173
|| request_type >= PAGING_REQUEST_TYPE_UNKNOWN) {
174174
/* Shouldn't go here */
175175
ASSERT(false, "Incorrect Arguments. Failed to map region");
176+
return 0;
176177
}
177178

178179
/* switch based on of table */
@@ -280,8 +281,8 @@ static uint32_t map_mem_region(void *vaddr, void *paddr,
280281
break;
281282
}
282283
default:
283-
ASSERT("Bad memory map request type" == 0, "");
284-
break;
284+
ASSERT(0, "Bad memory map request type");
285+
return 0;
285286
}
286287
}
287288

0 commit comments

Comments
 (0)