diff options
author | Jaehoon Chung <jh80.chung@samsung.com> | 2011-07-13 17:02:16 +0900 |
---|---|---|
committer | Xinyu Chen <xinyu.chen@freescale.com> | 2012-03-30 16:38:27 +0800 |
commit | 6de1ca5b3474beccec14809c5c8c4bf14606d79b (patch) | |
tree | 4d81a1f8ef25d6d727ecbdcf871bcf44d6f21252 /drivers | |
parent | 00a1f7ff036d54f9487f1a8cf62befe37bc6bada (diff) |
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.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Per Forlin <per.forlin@linaro.org>
Cc: <stable@kernel.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/card/block.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index ff3e9492d803..3f4303560a20 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); |