mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
mm: cma: Don't crash on allocation if CMA area can't be activated
If activation of the CMA area fails its mutex won't be initialized, leading to an oops at allocation time when trying to lock the mutex. Fix this by setting the cma area count field to 0 when activation fails, leading to allocation returning NULL immediately. Cc: <[email protected]> # v3.17 Signed-off-by: Laurent Pinchart <[email protected]> Acked-by: Michal Nazarewicz <[email protected]> Signed-off-by: Marek Szyprowski <[email protected]>
This commit is contained in:
parent
cac7f24298
commit
f022d8cb7e
1 changed files with 1 additions and 0 deletions
1
mm/cma.c
1
mm/cma.c
|
|
@ -124,6 +124,7 @@ static int __init cma_activate_area(struct cma *cma)
|
|||
|
||||
err:
|
||||
kfree(cma->bitmap);
|
||||
cma->count = 0;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue