aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehoon Chung <jh80.chung@samsung.com>2011-07-13 17:02:16 +0900
committerNicolas Pitre <nicolas.pitre@linaro.org>2011-07-14 15:45:18 -0400
commit5051d8ac6603d1b2067fa10f2fc6c2f8b7f557e5 (patch)
tree3452c2b6d6638af34378e2e2017257e6f22478c5
parent56d3914eb46cb440895c8a071f63ceed97c4e775 (diff)
mmc: block: fixed NULL pointer dereference
Hi. I send to mailing for [RFC] Kernel NULL pointer dereference. This patch is fixed it. In similar case, when discard request, check condition and performed mmc_blk_issue_rw_rq(mq, NULL) for ongoing async transfer. But When flush request, entered the mmc_blk_issue_flush() then return. (then didn't complete ongoing aync transfer). I think that need to complete for ongoing aync transfer before flush request. I tested with this patch, it's working fine. (SDHCI controller, eMMC4.41) Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Per Forlin <per.forlin@linaro.org> Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
-rw-r--r--drivers/mmc/card/block.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 22acdd7e5b2..41b12b455b1 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1059,6 +1059,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);