File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,7 @@ uint64_t e820_alloc_low_memory(uint32_t size_arg)
121
121
{
122
122
uint32_t i ;
123
123
uint32_t size = size_arg ;
124
+ uint64_t ret = ACRN_INVALID_HPA ;
124
125
struct e820_entry * entry , * new_entry ;
125
126
126
127
/* We want memory in page boundary and integral multiple of pages */
@@ -144,7 +145,8 @@ uint64_t e820_alloc_low_memory(uint32_t size_arg)
144
145
if (length == size ) {
145
146
entry -> type = E820_TYPE_RESERVED ;
146
147
e820_mem .total_mem_size -= size ;
147
- return start ;
148
+ ret = start ;
149
+ break ;
148
150
}
149
151
150
152
/*
@@ -161,11 +163,14 @@ uint64_t e820_alloc_low_memory(uint32_t size_arg)
161
163
e820_mem .total_mem_size -= new_entry -> length ;
162
164
e820_entries_count ++ ;
163
165
164
- return new_entry -> baseaddr ;
166
+ ret = new_entry -> baseaddr ;
167
+ break ;
165
168
}
166
169
167
- pr_fatal ("Can't allocate memory under 1M from E820\n" );
168
- return ACRN_INVALID_HPA ;
170
+ if (ret == ACRN_INVALID_HPA ) {
171
+ pr_fatal ("Can't allocate memory under 1M from E820\n" );
172
+ }
173
+ return ret ;
169
174
}
170
175
171
176
/* HV read multiboot header to get e820 entries info and calc total RAM info */
You can’t perform that action at this time.
0 commit comments