From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
To: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-sh@vger.kernel.org,
Marek Szyprowski <m.szyprowski@samsung.com>,
Russell King - ARM Linux <linux@arm.linux.org.uk>,
Michal Nazarewicz <mina86@mina86.com>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
Weijie Yang <weijie.yang.kh@gmail.com>
Subject: [PATCH v2 1/4] mm: cma: Don't crash on allocation if CMA area can't be activated
Date: Fri, 24 Oct 2014 13:18:39 +0300 [thread overview]
Message-ID: <1414145922-26042-2-git-send-email-laurent.pinchart+renesas@ideasonboard.com> (raw)
In-Reply-To: <1414145922-26042-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com>
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>
---
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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2014-10-24 10:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-24 10:18 [PATCH v2 0/4] Low/high memory CMA reservation fixes Laurent Pinchart
2014-10-24 10:18 ` Laurent Pinchart [this message]
2014-10-24 10:18 ` [PATCH v2 2/4] mm: cma: Always consider a 0 base address reservation as dynamic Laurent Pinchart
2014-10-24 10:18 ` [PATCH v2 3/4] mm: cma: Ensure that reservations never cross the low/high mem boundary Laurent Pinchart
2014-10-24 16:26 ` Michal Nazarewicz
2014-10-26 12:43 ` Laurent Pinchart
2014-10-27 7:44 ` Joonsoo Kim
2014-10-24 10:18 ` [PATCH v2 4/4] mm: cma: Use %pa to print physical addresses Laurent Pinchart
2014-10-27 12:13 ` [PATCH v2 0/4] Low/high memory CMA reservation fixes Marek Szyprowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1414145922-26042-2-git-send-email-laurent.pinchart+renesas@ideasonboard.com \
--to=laurent.pinchart+renesas@ideasonboard.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-sh@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=m.szyprowski@samsung.com \
--cc=mina86@mina86.com \
--cc=weijie.yang.kh@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox