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;