Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b2feda4f authored by Roland Dreier's avatar Roland Dreier Committed by Nicholas Bellinger
Browse files

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: default avatarRoland Dreier <roland@purestorage.com>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent a3541703
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -547,11 +547,11 @@ isert_create_pi_ctx(struct fast_reg_descriptor *desc,
	return 0;
	return 0;


err_prot_mr:
err_prot_mr:
	ib_dereg_mr(desc->pi_ctx->prot_mr);
	ib_dereg_mr(pi_ctx->prot_mr);
err_prot_frpl:
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:
err_pi_ctx:
	kfree(desc->pi_ctx);
	kfree(pi_ctx);


	return ret;
	return ret;
}
}