Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 416d82204df4 ("crypto: hisilicon - add HiSilicon SEC V2 driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Dan Carpenter and committed by
Herbert Xu
8a6b8f4d dbc2e87b

+2 -2
+2 -2
drivers/crypto/hisilicon/sec2/sec_crypto.c
··· 179 179 180 180 qp_ctx->c_in_pool = hisi_acc_create_sgl_pool(dev, QM_Q_DEPTH, 181 181 SEC_SGL_SGE_NR); 182 - if (!qp_ctx->c_in_pool) { 182 + if (IS_ERR(qp_ctx->c_in_pool)) { 183 183 dev_err(dev, "fail to create sgl pool for input!\n"); 184 184 goto err_free_req_list; 185 185 } 186 186 187 187 qp_ctx->c_out_pool = hisi_acc_create_sgl_pool(dev, QM_Q_DEPTH, 188 188 SEC_SGL_SGE_NR); 189 - if (!qp_ctx->c_out_pool) { 189 + if (IS_ERR(qp_ctx->c_out_pool)) { 190 190 dev_err(dev, "fail to create sgl pool for output!\n"); 191 191 goto err_free_c_in_pool; 192 192 }