aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ppa.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/ppa.c')
-rw-r--r--drivers/scsi/ppa.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/scsi/ppa.c b/drivers/scsi/ppa.c
index 67ee51a3d7e1..f655ae320b48 100644
--- a/drivers/scsi/ppa.c
+++ b/drivers/scsi/ppa.c
@@ -750,18 +750,16 @@ static int ppa_engine(ppa_struct *dev, struct scsi_cmnd *cmd)
750 cmd->SCp.phase++; 750 cmd->SCp.phase++;
751 751
752 case 4: /* Phase 4 - Setup scatter/gather buffers */ 752 case 4: /* Phase 4 - Setup scatter/gather buffers */
753 if (cmd->use_sg) { 753 if (scsi_bufflen(cmd)) {
754 /* if many buffers are available, start filling the first */ 754 cmd->SCp.buffer = scsi_sglist(cmd);
755 cmd->SCp.buffer = (struct scatterlist *) cmd->request_buffer;
756 cmd->SCp.this_residual = cmd->SCp.buffer->length; 755 cmd->SCp.this_residual = cmd->SCp.buffer->length;
757 cmd->SCp.ptr = sg_virt(cmd->SCp.buffer); 756 cmd->SCp.ptr = sg_virt(cmd->SCp.buffer);
758 } else { 757 } else {
759 /* else fill the only available buffer */
760 cmd->SCp.buffer = NULL; 758 cmd->SCp.buffer = NULL;
761 cmd->SCp.this_residual = cmd->request_bufflen; 759 cmd->SCp.this_residual = 0;
762 cmd->SCp.ptr = cmd->request_buffer; 760 cmd->SCp.ptr = NULL;
763 } 761 }
764 cmd->SCp.buffers_residual = cmd->use_sg - 1; 762 cmd->SCp.buffers_residual = scsi_sg_count(cmd) - 1;
765 cmd->SCp.phase++; 763 cmd->SCp.phase++;
766 764
767 case 5: /* Phase 5 - Data transfer stage */ 765 case 5: /* Phase 5 - Data transfer stage */