diff options
author | Roland Dreier <roland@purestorage.com> | 2015-05-30 02:12:10 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2015-05-30 23:01:04 -0400 |
commit | b2feda4feb1b0ea74c0916b4a35b038bbfef9c82 (patch) | |
tree | f2fab5419c4543973d9dad998a587768d29913b7 | |
parent | a3541703ebbf99d499656b15987175f6579b42ac (diff) |
iser-target: Fix error path in isert_create_pi_ctx()
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>
-rw-r--r-- | drivers/infiniband/ulp/isert/ib_isert.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index 327529ee85eb..3f40319a55da 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c | |||
@@ -547,11 +547,11 @@ isert_create_pi_ctx(struct fast_reg_descriptor *desc, | |||
547 | return 0; | 547 | return 0; |
548 | 548 | ||
549 | err_prot_mr: | 549 | err_prot_mr: |
550 | ib_dereg_mr(desc->pi_ctx->prot_mr); | 550 | ib_dereg_mr(pi_ctx->prot_mr); |
551 | err_prot_frpl: | 551 | err_prot_frpl: |
552 | ib_free_fast_reg_page_list(desc->pi_ctx->prot_frpl); | 552 | ib_free_fast_reg_page_list(pi_ctx->prot_frpl); |
553 | err_pi_ctx: | 553 | err_pi_ctx: |
554 | kfree(desc->pi_ctx); | 554 | kfree(pi_ctx); |
555 | 555 | ||
556 | return ret; | 556 | return ret; |
557 | } | 557 | } |