Skip to content

Commit 8a6b8f4

Browse files
Dan Carpenterherbertx
authored andcommitted
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: 416d822 ("crypto: hisilicon - add HiSilicon SEC V2 driver") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent dbc2e87 commit 8a6b8f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/crypto/hisilicon/sec2/sec_crypto.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,14 @@ static int sec_create_qp_ctx(struct hisi_qm *qm, struct sec_ctx *ctx,
179179

180180
qp_ctx->c_in_pool = hisi_acc_create_sgl_pool(dev, QM_Q_DEPTH,
181181
SEC_SGL_SGE_NR);
182-
if (!qp_ctx->c_in_pool) {
182+
if (IS_ERR(qp_ctx->c_in_pool)) {
183183
dev_err(dev, "fail to create sgl pool for input!\n");
184184
goto err_free_req_list;
185185
}
186186

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

0 commit comments

Comments
 (0)