mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
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: Joonsoo Kim <[email protected]> Acked-by: Minchan Kim <[email protected]> Reviewed-by: Michal Nazarewicz <[email protected]> Reviewed-by: Zhang Yanfei <[email protected]> Reviewed-by: Aneesh Kumar K.V <[email protected]> Cc: Alexander Graf <[email protected]> Cc: Aneesh Kumar K.V <[email protected]> Cc: Gleb Natapov <[email protected]> Acked-by: Marek Szyprowski <[email protected]> Tested-by: Marek Szyprowski <[email protected]> Cc: Paolo Bonzini <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Paul Mackerras <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
fc95ca7284
commit
b7155e76a7
1 changed files with 4 additions and 3 deletions
7
mm/cma.c
7
mm/cma.c
|
|
@ -285,11 +285,12 @@ struct page *cma_alloc(struct cma *cma, int count, unsigned int align)
|
|||
if (ret == 0) {
|
||||
page = pfn_to_page(pfn);
|
||||
break;
|
||||
} else if (ret != -EBUSY) {
|
||||
cma_clear_bitmap(cma, pfn, count);
|
||||
break;
|
||||
}
|
||||
|
||||
cma_clear_bitmap(cma, pfn, count);
|
||||
if (ret != -EBUSY)
|
||||
break;
|
||||
|
||||
pr_debug("%s(): memory range at %p is busy, retrying\n",
|
||||
__func__, pfn_to_page(pfn));
|
||||
/* try again with a bit different memory target */
|
||||
|
|
|
|||
Loading…
Reference in a new issue