Commit f022d8cb authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Marek Szyprowski

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: <>  # v3.17
Signed-off-by: default avatarLaurent Pinchart <>
Acked-by: default avatarMichal Nazarewicz <>
Signed-off-by: default avatarMarek Szyprowski <>
parent cac7f242
......@@ -124,6 +124,7 @@ static int __init cma_activate_area(struct cma *cma)
cma->count = 0;
return -EINVAL;
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