]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[SCSI] qlogicpti: fix sg list traversal error in continuation entries
authorBoaz Harrosh <bharrosh@panasas.com>
Wed, 24 Sep 2008 09:00:22 +0000 (12:00 +0300)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Sun, 28 Sep 2008 22:10:40 +0000 (17:10 -0500)
The current sg list traversal logic for the continuation entries
doesn't advance the list pointer once all seven slots are used, so the
next continuation entry (if there is one) wrongly begins again at the
start of the sg list.

Fix by advancing the sg pointer after the for_each_sg().

Reported-by: Meelis Roos <mroos@ut.ee>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/qlogicpti.c

index 4a1cf6377f6c89b7a654bf3c38e9e2ae8b1bcc4f..9053508967253b9d894efefbd81bdc1bf125e725 100644 (file)
@@ -914,6 +914,7 @@ static inline int load_cmd(struct scsi_cmnd *Cmnd, struct Command_Entry *cmd,
                                ds[i].d_count = sg_dma_len(s);
                        }
                        sg_count -= n;
+                       sg = s;
                }
        } else {
                cmd->dataseg[0].d_base = 0;