diff options
author | Jaehoon Chung <jh80.chung@samsung.com> | 2011-07-13 04:02:16 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-07-21 10:35:00 -0400 |
commit | 393f9a08e2ee72e42379489a5781feaf9c406d5f (patch) | |
tree | 3b360c42c9449e4bcf320ade4c0048b98bfbe4d4 /drivers/mmc/card | |
parent | 7937e878f91ccc32c09177f44cfdc45183d78605 (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/mmc/card')
-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 38d01492a52b..1ff5486213fb 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) | |||
1200 | else | 1200 | else |
1201 | ret = mmc_blk_issue_discard_rq(mq, req); | 1201 | ret = mmc_blk_issue_discard_rq(mq, req); |
1202 | } else if (req && req->cmd_flags & REQ_FLUSH) { | 1202 | } else if (req && req->cmd_flags & REQ_FLUSH) { |
1203 | /* complete ongoing async transfer before issuing flush */ | ||
1204 | if (card->host->areq) | ||
1205 | mmc_blk_issue_rw_rq(mq, NULL); | ||
1203 | ret = mmc_blk_issue_flush(mq, req); | 1206 | ret = mmc_blk_issue_flush(mq, req); |
1204 | } else { | 1207 | } else { |
1205 | ret = mmc_blk_issue_rw_rq(mq, req); | 1208 | ret = mmc_blk_issue_rw_rq(mq, req); |