Commit 8a6b8f4d authored by Dan Carpenter's avatar Dan Carpenter Committed by Herbert Xu
Browse files

crypto: hisilicon - fix a NULL vs IS_ERR() bug in sec_create_qp_ctx()



The hisi_acc_create_sgl_pool() function returns error pointers, it never
returns NULL pointers.

Fixes: 416d8220 ("crypto: hisilicon - add HiSilicon SEC V2 driver")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent dbc2e87b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -179,14 +179,14 @@ static int sec_create_qp_ctx(struct hisi_qm *qm, struct sec_ctx *ctx,

	qp_ctx->c_in_pool = hisi_acc_create_sgl_pool(dev, QM_Q_DEPTH,
						     SEC_SGL_SGE_NR);
	if (!qp_ctx->c_in_pool) {
	if (IS_ERR(qp_ctx->c_in_pool)) {
		dev_err(dev, "fail to create sgl pool for input!\n");
		goto err_free_req_list;
	}

	qp_ctx->c_out_pool = hisi_acc_create_sgl_pool(dev, QM_Q_DEPTH,
						      SEC_SGL_SGE_NR);
	if (!qp_ctx->c_out_pool) {
	if (IS_ERR(qp_ctx->c_out_pool)) {
		dev_err(dev, "fail to create sgl pool for output!\n");
		goto err_free_c_in_pool;
	}