1 From 61009f82a93f7c0b33cd9b3b263a6ab48f8b49d4 Mon Sep 17 00:00:00 2001
2 From: Dan Carpenter <dan.carpenter@oracle.com>
3 Date: Fri, 10 May 2019 14:24:41 +0300
4 Subject: memstick: mspro_block: Fix an error code in mspro_block_issue_req()
6 From: Dan Carpenter <dan.carpenter@oracle.com>
8 commit 61009f82a93f7c0b33cd9b3b263a6ab48f8b49d4 upstream.
10 We accidentally changed the error code from -EAGAIN to 1 when we did the
13 Maybe a contributing factor to this mistake is that it wasn't obvious
14 that the "while (chunk) {" condition is always true. I have cleaned
17 Fixes: d0be12274dad ("mspro_block: convert to blk-mq")
18 Cc: stable@vger.kernel.org
19 Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
20 Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
21 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24 drivers/memstick/core/mspro_block.c | 13 ++++++-------
25 1 file changed, 6 insertions(+), 7 deletions(-)
27 --- a/drivers/memstick/core/mspro_block.c
28 +++ b/drivers/memstick/core/mspro_block.c
29 @@ -694,13 +694,13 @@ static void h_mspro_block_setup_cmd(stru
31 /*** Data transfer ***/
33 -static int mspro_block_issue_req(struct memstick_dev *card, bool chunk)
34 +static int mspro_block_issue_req(struct memstick_dev *card)
36 struct mspro_block_data *msb = memstick_get_drvdata(card);
42 msb->current_page = 0;
44 msb->seg_count = blk_rq_map_sg(msb->block_req->q,
45 @@ -709,6 +709,7 @@ static int mspro_block_issue_req(struct
47 if (!msb->seg_count) {
48 unsigned int bytes = blk_rq_cur_bytes(msb->block_req);
51 chunk = blk_update_request(msb->block_req,
53 @@ -718,7 +719,7 @@ static int mspro_block_issue_req(struct
54 __blk_mq_end_request(msb->block_req,
56 msb->block_req = NULL;
61 t_off = blk_rq_pos(msb->block_req);
62 @@ -735,8 +736,6 @@ static int mspro_block_issue_req(struct
63 memstick_new_req(card->host);
70 static int mspro_block_complete_req(struct memstick_dev *card, int error)
71 @@ -779,7 +778,7 @@ static int mspro_block_complete_req(stru
72 chunk = blk_update_request(msb->block_req,
73 errno_to_blk_status(error), t_len);
75 - error = mspro_block_issue_req(card, chunk);
76 + error = mspro_block_issue_req(card);
80 @@ -849,7 +848,7 @@ static blk_status_t mspro_queue_rq(struc
81 msb->block_req = bd->rq;
82 blk_mq_start_request(bd->rq);
84 - if (mspro_block_issue_req(card, true))
85 + if (mspro_block_issue_req(card))
86 msb->block_req = NULL;
88 spin_unlock_irq(&msb->q_lock);