aboutsummaryrefslogtreecommitdiffstats
path: root/mm/cma.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/cma.c')
-rw-r--r--mm/cma.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/cma.c b/mm/cma.c
index 5aa1a6f74dec..62a5dccc3fb8 100644
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -245,6 +245,9 @@ int __init cma_declare_contiguous(phys_addr_t base,
245 size = ALIGN(size, alignment); 245 size = ALIGN(size, alignment);
246 limit &= ~(alignment - 1); 246 limit &= ~(alignment - 1);
247 247
248 if (!base)
249 fixed = false;
250
248 /* size should be aligned with order_per_bit */ 251 /* size should be aligned with order_per_bit */
249 if (!IS_ALIGNED(size >> PAGE_SHIFT, 1 << order_per_bit)) 252 if (!IS_ALIGNED(size >> PAGE_SHIFT, 1 << order_per_bit))
250 return -EINVAL; 253 return -EINVAL;
@@ -268,7 +271,7 @@ int __init cma_declare_contiguous(phys_addr_t base,
268 } 271 }
269 272
270 /* Reserve memory */ 273 /* Reserve memory */
271 if (base && fixed) { 274 if (fixed) {
272 if (memblock_is_region_reserved(base, size) || 275 if (memblock_is_region_reserved(base, size) ||
273 memblock_reserve(base, size) < 0) { 276 memblock_reserve(base, size) < 0) {
274 ret = -EBUSY; 277 ret = -EBUSY;