diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index cb1698f268f19023429df520713f20a3de6f6d25..5f942a34d65c668d20112eb670efb0cc5ebc2744 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -1152,7 +1152,7 @@ static int mmc_blk_issue_discard_rq(struct mmc_queue *mq, struct request *req) if (!mmc_can_erase(card)) { err = -EOPNOTSUPP; - goto out; + goto fail; } from = blk_rq_pos(req); @@ -1181,6 +1181,7 @@ static int mmc_blk_issue_discard_rq(struct mmc_queue *mq, struct request *req) goto retry; if (!err) mmc_blk_reset_success(md, type); +fail: blk_end_request(req, err, blk_rq_bytes(req)); return err ? 0 : 1;