aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Dreier <roland@purestorage.com>2015-05-30 02:12:10 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2015-05-30 23:01:04 -0400
commitb2feda4feb1b0ea74c0916b4a35b038bbfef9c82 (patch)
treef2fab5419c4543973d9dad998a587768d29913b7
parenta3541703ebbf99d499656b15987175f6579b42ac (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.c6
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
549err_prot_mr: 549err_prot_mr:
550 ib_dereg_mr(desc->pi_ctx->prot_mr); 550 ib_dereg_mr(pi_ctx->prot_mr);
551err_prot_frpl: 551err_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);
553err_pi_ctx: 553err_pi_ctx:
554 kfree(desc->pi_ctx); 554 kfree(pi_ctx);
555 555
556 return ret; 556 return ret;
557} 557}