aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/ub.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/ub.c')
-rw-r--r--drivers/block/ub.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/block/ub.c b/drivers/block/ub.c
index 689cd27ac890..8c2cc71327e3 100644
--- a/drivers/block/ub.c
+++ b/drivers/block/ub.c
@@ -783,10 +783,8 @@ static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
783 783
784 if (cmd->error == 0) { 784 if (cmd->error == 0) {
785 if (blk_pc_request(rq)) { 785 if (blk_pc_request(rq)) {
786 if (cmd->act_len >= rq->data_len) 786 if (cmd->act_len < rq->data_len)
787 rq->data_len = 0; 787 rq->resid_len = rq->data_len - cmd->act_len;
788 else
789 rq->data_len -= cmd->act_len;
790 scsi_status = 0; 788 scsi_status = 0;
791 } else { 789 } else {
792 if (cmd->act_len != cmd->len) { 790 if (cmd->act_len != cmd->len) {