aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mmc/mmc_block.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/mmc/mmc_block.c b/drivers/mmc/mmc_block.c
index 5025abebfc82..87713572293f 100644
--- a/drivers/mmc/mmc_block.c
+++ b/drivers/mmc/mmc_block.c
@@ -224,10 +224,10 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
224 struct mmc_blk_data *md = mq->data; 224 struct mmc_blk_data *md = mq->data;
225 struct mmc_card *card = md->queue.card; 225 struct mmc_card *card = md->queue.card;
226 struct mmc_blk_request brq; 226 struct mmc_blk_request brq;
227 int ret; 227 int ret = 1;
228 228
229 if (mmc_card_claim_host(card)) 229 if (mmc_card_claim_host(card))
230 goto cmd_err; 230 goto flush_queue;
231 231
232 do { 232 do {
233 struct mmc_command cmd; 233 struct mmc_command cmd;
@@ -344,8 +344,6 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
344 return 1; 344 return 1;
345 345
346 cmd_err: 346 cmd_err:
347 ret = 1;
348
349 /* 347 /*
350 * If this is an SD card and we're writing, we can first 348 * If this is an SD card and we're writing, we can first
351 * mark the known good sectors as ok. 349 * mark the known good sectors as ok.
@@ -379,6 +377,7 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
379 377
380 mmc_card_release_host(card); 378 mmc_card_release_host(card);
381 379
380flush_queue:
382 spin_lock_irq(&md->lock); 381 spin_lock_irq(&md->lock);
383 while (ret) { 382 while (ret) {
384 ret = end_that_request_chunk(req, 0, 383 ret = end_that_request_chunk(req, 0,