Commit dc92d146 authored by Nelson Escobar's avatar Nelson Escobar Committed by Doug Ledford

IB/usnic: Fix resource leak in error case

Signed-off-by: default avatarDave Goodell <dgoodell@cisco.com>
Reviewed-by: default avatarReese Faucette <rfaucett@cisco.com>
Reviewed-by: default avatarXuyang Wang <xuywang@cisco.com>
Signed-off-by: default avatarNelson Escobar <neescoba@cisco.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 89e5323c
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment