diff options
Diffstat (limited to 'drivers/scsi/ips.c')
-rw-r--r-- | drivers/scsi/ips.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c index 2ed099e2c20d..edaac2714c5a 100644 --- a/drivers/scsi/ips.c +++ b/drivers/scsi/ips.c | |||
@@ -3252,7 +3252,7 @@ ips_done(ips_ha_t * ha, ips_scb_t * scb) | |||
3252 | */ | 3252 | */ |
3253 | if ((scb->breakup) || (scb->sg_break)) { | 3253 | if ((scb->breakup) || (scb->sg_break)) { |
3254 | struct scatterlist *sg; | 3254 | struct scatterlist *sg; |
3255 | int sg_dma_index, ips_sg_index = 0; | 3255 | int i, sg_dma_index, ips_sg_index = 0; |
3256 | 3256 | ||
3257 | /* we had a data breakup */ | 3257 | /* we had a data breakup */ |
3258 | scb->data_len = 0; | 3258 | scb->data_len = 0; |
@@ -3261,20 +3261,22 @@ ips_done(ips_ha_t * ha, ips_scb_t * scb) | |||
3261 | 3261 | ||
3262 | /* Spin forward to last dma chunk */ | 3262 | /* Spin forward to last dma chunk */ |
3263 | sg_dma_index = scb->breakup; | 3263 | sg_dma_index = scb->breakup; |
3264 | for (i = 0; i < scb->breakup; i++) | ||
3265 | sg = sg_next(sg); | ||
3264 | 3266 | ||
3265 | /* Take care of possible partial on last chunk */ | 3267 | /* Take care of possible partial on last chunk */ |
3266 | ips_fill_scb_sg_single(ha, | 3268 | ips_fill_scb_sg_single(ha, |
3267 | sg_dma_address(&sg[sg_dma_index]), | 3269 | sg_dma_address(sg), |
3268 | scb, ips_sg_index++, | 3270 | scb, ips_sg_index++, |
3269 | sg_dma_len(&sg[sg_dma_index])); | 3271 | sg_dma_len(sg)); |
3270 | 3272 | ||
3271 | for (; sg_dma_index < scsi_sg_count(scb->scsi_cmd); | 3273 | for (; sg_dma_index < scsi_sg_count(scb->scsi_cmd); |
3272 | sg_dma_index++) { | 3274 | sg_dma_index++, sg = sg_next(sg)) { |
3273 | if (ips_fill_scb_sg_single | 3275 | if (ips_fill_scb_sg_single |
3274 | (ha, | 3276 | (ha, |
3275 | sg_dma_address(&sg[sg_dma_index]), | 3277 | sg_dma_address(sg), |
3276 | scb, ips_sg_index++, | 3278 | scb, ips_sg_index++, |
3277 | sg_dma_len(&sg[sg_dma_index])) < 0) | 3279 | sg_dma_len(sg)) < 0) |
3278 | break; | 3280 | break; |
3279 | } | 3281 | } |
3280 | 3282 | ||