IB/usnic: Fix resource leak in error case

Signed-off-by: Dave Goodell <dgoodell@cisco.com>
Reviewed-by: Reese Faucette <rfaucett@cisco.com>
Reviewed-by: Xuyang Wang <xuywang@cisco.com>
Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
Nelson Escobar 2015-12-09 10:42:18 -08:00 committed by Doug Ledford
parent 89e5323c64
commit dc92d14684
1 changed files with 1 additions and 1 deletions

View File

@ -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);