isert: Fix page leak if alloc_page fails

Signed-off-by: Yan Burman <yanb@mellanox.com>

git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5871 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Yan Burman
2014-11-16 13:25:01 +00:00
parent 28781d1545
commit 6b3d77bc37

View File

@@ -85,7 +85,7 @@ static int isert_buf_alloc_pg(struct ib_device *ib_dev,
goto out;
out_map_failed:
for (; i > 0; --i)
for (; i >= 0; --i)
__free_page(sg_page(&isert_buf->sg[i]));
kfree(isert_buf->sg);
isert_buf->sg = NULL;