|
@@ -245,6 +245,9 @@ int __init cma_declare_contiguous(phys_addr_t base,
|
|
size = ALIGN(size, alignment);
|
|
size = ALIGN(size, alignment);
|
|
limit &= ~(alignment - 1);
|
|
limit &= ~(alignment - 1);
|
|
|
|
|
|
|
|
+ if (!base)
|
|
|
|
+ fixed = false;
|
|
|
|
+
|
|
/* size should be aligned with order_per_bit */
|
|
/* size should be aligned with order_per_bit */
|
|
if (!IS_ALIGNED(size >> PAGE_SHIFT, 1 << order_per_bit))
|
|
if (!IS_ALIGNED(size >> PAGE_SHIFT, 1 << order_per_bit))
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
@@ -268,7 +271,7 @@ int __init cma_declare_contiguous(phys_addr_t base,
|
|
}
|
|
}
|
|
|
|
|
|
/* Reserve memory */
|
|
/* Reserve memory */
|
|
- if (base && fixed) {
|
|
|
|
|
|
+ if (fixed) {
|
|
if (memblock_is_region_reserved(base, size) ||
|
|
if (memblock_is_region_reserved(base, size) ||
|
|
memblock_reserve(base, size) < 0) {
|
|
memblock_reserve(base, size) < 0) {
|
|
ret = -EBUSY;
|
|
ret = -EBUSY;
|