The patch below does not apply to the 3.0-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <sta...@kernel.org>.
thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 393f9a08e2ee72e42379489a5781feaf9c406d5f Mon Sep 17 00:00:00 2001 From: Jaehoon Chung <jh80.ch...@samsung.com> Date: Wed, 13 Jul 2011 17:02:16 +0900 Subject: [PATCH] mmc: block: fixed NULL pointer dereference We already check for ongoing async transfers when handling discard requests, but not in mmc_blk_issue_flush(). This patch fixes that omission. Tested with an SDHCI controller and eMMC4.41. Signed-off-by: Jaehoon Chung <jh80.ch...@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.p...@samsung.com> Acked-by: Per Forlin <per.for...@linaro.org> Cc: <sta...@kernel.org> Signed-off-by: Chris Ball <c...@laptop.org> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 38d0149..1ff5486 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -1200,6 +1200,9 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) else ret = mmc_blk_issue_discard_rq(mq, req); } else if (req && req->cmd_flags & REQ_FLUSH) { + /* complete ongoing async transfer before issuing flush */ + if (card->host->areq) + mmc_blk_issue_rw_rq(mq, NULL); ret = mmc_blk_issue_flush(mq, req); } else { ret = mmc_blk_issue_rw_rq(mq, req); _______________________________________________ stable mailing list stable@linux.kernel.org http://linux.kernel.org/mailman/listinfo/stable