mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
mm/cma.c: fix crash on CMA allocation if bitmap allocation fails
f022d8cb7e ("mm: cma: Don't crash on allocation if CMA area can't be
activated") fixes the crash issue when activation fails via setting
cma->count as 0, same logic exists if bitmap allocation fails.
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Yue Hu <[email protected]>
Reviewed-by: Anshuman Khandual <[email protected]>
Cc: Joonsoo Kim <[email protected]>
Cc: Laura Abbott <[email protected]>
Cc: Mike Rapoport <[email protected]>
Cc: Randy Dunlap <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
113b7dfd82
commit
1df3a33907
1 changed files with 3 additions and 1 deletions
4
mm/cma.c
4
mm/cma.c
|
|
@ -106,8 +106,10 @@ static int __init cma_activate_area(struct cma *cma)
|
|||
|
||||
cma->bitmap = kzalloc(bitmap_size, GFP_KERNEL);
|
||||
|
||||
if (!cma->bitmap)
|
||||
if (!cma->bitmap) {
|
||||
cma->count = 0;
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
WARN_ON_ONCE(!pfn_valid(pfn));
|
||||
zone = page_zone(pfn_to_page(pfn));
|
||||
|
|
|
|||
Loading…
Reference in a new issue