Skip to content

Commit

Permalink
memstick: mspro_block: add missing curly braces
Browse files Browse the repository at this point in the history
commit 13f6b19 upstream.

Using the indenting we can see the curly braces were obviously intended.
This is a static checker fix, but my guess is that we don't read enough
bytes, because we don't calculate "t_len" correctly.

Fixes: f1d8269 ('memstick: use fully asynchronous request processing')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Alex Dubov <oakad@yahoo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed May 6, 2015
1 parent 9280cd6 commit 6e2d6fb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/memstick/core/mspro_block.c
Original file line number Diff line number Diff line change
Expand Up @@ -758,14 +758,15 @@ static int mspro_block_complete_req(struct memstick_dev *card, int error)

if (error || (card->current_mrq.tpc == MSPRO_CMD_STOP)) {
if (msb->data_dir == READ) {
for (cnt = 0; cnt < msb->current_seg; cnt++)
for (cnt = 0; cnt < msb->current_seg; cnt++) {
t_len += msb->req_sg[cnt].length
/ msb->page_size;

if (msb->current_page)
t_len += msb->current_page - 1;

t_len *= msb->page_size;
}
}
} else
t_len = blk_rq_bytes(msb->block_req);
Expand Down

0 comments on commit 6e2d6fb

Please sign in to comment.