From 6b3d77bc37a4da5ac468b1f1bf6a174d21f645fe Mon Sep 17 00:00:00 2001 From: Yan Burman Date: Sun, 16 Nov 2014 13:25:01 +0000 Subject: [PATCH] isert: Fix page leak if alloc_page fails Signed-off-by: Yan Burman git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5871 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/isert-scst/iser_buf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iscsi-scst/kernel/isert-scst/iser_buf.c b/iscsi-scst/kernel/isert-scst/iser_buf.c index 0380fae93..20a5f5bf6 100644 --- a/iscsi-scst/kernel/isert-scst/iser_buf.c +++ b/iscsi-scst/kernel/isert-scst/iser_buf.c @@ -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;