From c728d4e3af1a7ea219c4cfed2a2e54332b60d38b Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 11 Jun 2015 16:25:50 +0000 Subject: [PATCH] Merge r5870 from the iser branch git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@6262 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/isert-scst/iser_buf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iscsi-scst/kernel/isert-scst/iser_buf.c b/iscsi-scst/kernel/isert-scst/iser_buf.c index dd418f0de..1458bde5d 100644 --- a/iscsi-scst/kernel/isert-scst/iser_buf.c +++ b/iscsi-scst/kernel/isert-scst/iser_buf.c @@ -72,6 +72,7 @@ static int isert_buf_alloc_pg(struct ib_device *ib_dev, res = ib_dma_map_sg(ib_dev, isert_buf->sg, isert_buf->sg_cnt, dma_dir); if (unlikely(!res)) { + --i; /* do not overrun isert_buf->sg */ pr_err("Failed to DMA map iser sg:%p len:%d\n", isert_buf->sg, isert_buf->sg_cnt); res = -ENOMEM;