From: Nelson Escobar Date: Wed, 9 Dec 2015 18:42:18 +0000 (-0800) Subject: IB/usnic: Fix resource leak in error case X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=dc92d14684c066f81f120e740ef38b87f37e0622;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git IB/usnic: Fix resource leak in error case Signed-off-by: Dave Goodell Reviewed-by: Reese Faucette Reviewed-by: Xuyang Wang Signed-off-by: Nelson Escobar Signed-off-by: Doug Ledford --- diff --git a/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c b/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c index b3068704f079..5f44b66ccb86 100644 --- a/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c +++ b/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c @@ -575,7 +575,7 @@ alloc_res_chunk_list(struct usnic_vnic *vnic, return res_chunk_list; out_free_res: - for (i--; i > 0; i--) + for (i--; i >= 0; i--) usnic_vnic_put_resources(res_chunk_list[i]); kfree(res_chunk_list); return ERR_PTR(err);