OSDN Git Service

mmc: block: Return error in case of partition switch failure
authorSayali Lokhande <sayalil@codeaurora.org>
Wed, 4 Oct 2017 10:12:18 +0000 (15:42 +0530)
committerGerrit - the friendly Code Review server <code-review@localhost>
Fri, 6 Oct 2017 04:42:06 +0000 (21:42 -0700)
If some error occurs in mmc_blk_cmdq_part_switch() function,
the error is not being passed to higher layers to inform the
failure. Instead it returns zero even though no request is
completed with success. This change returns error to higher
layers in case of any failures in mmc_blk_cmdq_part_switch.

Change-Id: Icd1d2d9bc6bb5bd16bc24706fb20603cc33cee40
Signed-off-by: Sayali Lokhande <sayalil@codeaurora.org>
drivers/mmc/card/block.c

index c002fa5..d053409 100644 (file)
@@ -4000,7 +4000,7 @@ static int mmc_blk_cmdq_issue_rq(struct mmc_queue *mq, struct request *req)
                } else {
                        pr_err("%s: %s: partition switch failed err = %d\n",
                                md->disk->disk_name, __func__, err);
-                       ret = 0;
+                       ret = err;
                        goto out;
                }
        }