Commit b7155e76 authored by Joonsoo Kim's avatar Joonsoo Kim Committed by Linus Torvalds

mm, CMA: clean-up CMA allocation error path

We can remove one call sites for clear_cma_bitmap() if we first call it
before checking error number.
Signed-off-by: default avatarJoonsoo Kim <>
Acked-by: default avatarMinchan Kim <>
Reviewed-by: default avatarMichal Nazarewicz <>
Reviewed-by: default avatarZhang Yanfei <>
Reviewed-by: default avatarAneesh Kumar K.V <>
Cc: Alexander Graf <>
Cc: Aneesh Kumar K.V <>
Cc: Gleb Natapov <>
Acked-by: default avatarMarek Szyprowski <>
Tested-by: default avatarMarek Szyprowski <>
Cc: Paolo Bonzini <>
Cc: Benjamin Herrenschmidt <>
Cc: Paul Mackerras <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent fc95ca72
......@@ -285,11 +285,12 @@ struct page *cma_alloc(struct cma *cma, int count, unsigned int align)
if (ret == 0) {
page = pfn_to_page(pfn);
} else if (ret != -EBUSY) {
cma_clear_bitmap(cma, pfn, count);
cma_clear_bitmap(cma, pfn, count);
if (ret != -EBUSY)
pr_debug("%s(): memory range at %p is busy, retrying\n",
__func__, pfn_to_page(pfn));
/* try again with a bit different memory target */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment