[PATCH] mmc: block: return errorcode and not 0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The function mmc_sd_num_wr_blocks() was changed in
9a5e7ddc7954: "mmc: block: return errorcode from mmc_sd_num_wr_blocks()"
to return err; but this was fixed in
65f2da1ecb36: "mmc: block: return 0 where evident"
as clearly err was anyways zero.

Well the first commit was wrong, we should have returned an
errorcode all the time.

Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Fixes: 65f2da1ecb36: ("mmc: block: return 0 where evident")
Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
---
Ulf please apply this for fixes.
---
 drivers/mmc/core/block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index 985477cdcb3e..cd909aecfded 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -783,7 +783,7 @@ static int mmc_sd_num_wr_blocks(struct mmc_card *card, u32 *written_blocks)
 	if (err)
 		return err;
 	if (!mmc_host_is_spi(card->host) && !(cmd.resp[0] & R1_APP_CMD))
-		return 0;
+		return -EIO;
 
 	memset(&cmd, 0, sizeof(struct mmc_command));
 
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux