Skip to content

Commit

Permalink
iser-target: Fix error path in isert_create_pi_ctx()
Browse files Browse the repository at this point in the history
We don't assign pi_ctx to desc->pi_ctx until we're certain to succeed
in the function.  That means the cleanup path should use the local
pi_ctx variable, not desc->pi_ctx.

This was detected by Coverity (CID 1260062).

Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  • Loading branch information
rolandd authored and Nicholas Bellinger committed May 31, 2015
1 parent a354170 commit b2feda4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/infiniband/ulp/isert/ib_isert.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,11 +547,11 @@ isert_create_pi_ctx(struct fast_reg_descriptor *desc,
return 0;

err_prot_mr:
ib_dereg_mr(desc->pi_ctx->prot_mr);
ib_dereg_mr(pi_ctx->prot_mr);
err_prot_frpl:
ib_free_fast_reg_page_list(desc->pi_ctx->prot_frpl);
ib_free_fast_reg_page_list(pi_ctx->prot_frpl);
err_pi_ctx:
kfree(desc->pi_ctx);
kfree(pi_ctx);

return ret;
}
Expand Down

0 comments on commit b2feda4

Please sign in to comment.