diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2014-10-24 13:18:39 +0300 |
---|---|---|
committer | Marek Szyprowski <m.szyprowski@samsung.com> | 2014-10-27 13:00:54 +0100 |
commit | f022d8cb7ec70fe8edd56383d876001317ee76b1 (patch) | |
tree | 3d45621da991a4b2b567c4447851fe6f7b5e87c3 /mm | |
parent | cac7f2429872d3733dc3f9915857b1691da2eb2f (diff) | |
download | linux-f022d8cb7ec70fe8edd56383d876001317ee76b1.tar.gz linux-f022d8cb7ec70fe8edd56383d876001317ee76b1.tar.bz2 linux-f022d8cb7ec70fe8edd56383d876001317ee76b1.zip |
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: <stable@vger.kernel.org> # v3.17
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/cma.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -124,6 +124,7 @@ static int __init cma_activate_area(struct cma *cma) err: kfree(cma->bitmap); + cma->count = 0; return -EINVAL; } |