linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] IA64: iommu uses sg_next with an invalid sg element
@ 2007-10-17  8:49 FUJITA Tomonori
  2007-10-17  8:51 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: FUJITA Tomonori @ 2007-10-17  8:49 UTC (permalink / raw)
  To: linux-kernel, jens.axboe, tony.luck; +Cc: linux-scsi, tomof

sg list elements might not be continuous.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
 arch/ia64/hp/common/sba_iommu.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c
index 4338f41..3c95f41 100644
--- a/arch/ia64/hp/common/sba_iommu.c
+++ b/arch/ia64/hp/common/sba_iommu.c
@@ -1179,7 +1179,6 @@ sba_fill_pdir(
 	u64 *pdirp = NULL;
 	unsigned long dma_offset = 0;
 
-	dma_sg--;
 	while (nents-- > 0) {
 		int     cnt = startsg->dma_length;
 		startsg->dma_length = 0;
@@ -1201,7 +1200,8 @@ sba_fill_pdir(
 			u32 pide = startsg->dma_address & ~PIDE_FLAG;
 			dma_offset = (unsigned long) pide & ~iovp_mask;
 			startsg->dma_address = 0;
-			dma_sg = sg_next(dma_sg);
+			if (n_mappings)
+				dma_sg = sg_next(dma_sg);
 			dma_sg->dma_address = pide | ioc->ibase;
 			pdirp = &(ioc->pdir_base[pide >> iovp_shift]);
 			n_mappings++;
-- 
1.5.2.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] IA64: iommu uses sg_next with an invalid sg element
  2007-10-17  8:49 [PATCH] IA64: iommu uses sg_next with an invalid sg element FUJITA Tomonori
@ 2007-10-17  8:51 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2007-10-17  8:51 UTC (permalink / raw)
  To: FUJITA Tomonori; +Cc: linux-kernel, tony.luck, linux-scsi, tomof

On Wed, Oct 17 2007, FUJITA Tomonori wrote:
> sg list elements might not be continuous.

Thanks, applied.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-10-17  8:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-17  8:49 [PATCH] IA64: iommu uses sg_next with an invalid sg element FUJITA Tomonori
2007-10-17  8:51 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).