From: Boaz Harrosh Date: Wed, 24 Sep 2008 09:00:22 +0000 (+0300) Subject: [SCSI] qlogicpti: fix sg list traversal error in continuation entries X-Git-Tag: v2.6.27-rc8~8^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c9eeb248f3b44939532a9716bc06413383aa5d63;p=platform%2Fupstream%2Fkernel-adaptation-pc.git [SCSI] qlogicpti: fix sg list traversal error in continuation entries 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 Cc: David Miller Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c index 4a1cf63..9053508 100644 --- a/drivers/scsi/qlogicpti.c +++ b/drivers/scsi/qlogicpti.c @@ -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;