[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1414145922-26042-2-git-send-email-laurent.pinchart+renesas@ideasonboard.com>
Date: Fri, 24 Oct 2014 13:18:39 +0300
From: Laurent Pinchart <laurent.pinchart+renesas@...asonboard.com>
To: linux-mm@...ck.org
Cc: linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-sh@...r.kernel.org,
Marek Szyprowski <m.szyprowski@...sung.com>,
Russell King - ARM Linux <linux@....linux.org.uk>,
Michal Nazarewicz <mina86@...a86.com>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
Weijie Yang <weijie.yang.kh@...il.com>
Subject: [PATCH v2 1/4] 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@...r.kernel.org> # v3.17
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@...asonboard.com>
Acked-by: Michal Nazarewicz <mina86@...a86.com>
---
mm/cma.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/mm/cma.c b/mm/cma.c
index 963bc4add9af..5aa1a6f74dec 100644
--- a/mm/cma.c
+++ b/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;
}
--
2.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists