From: nieweiqiang Date: Sat, 25 Oct 2025 10:12:57 +0000 (+0800) Subject: crypto: hisilicon/sgl - remove unnecessary checks for curr_hw_sgl error X-Git-Tag: v6.19-rc1~185^2~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51996331f713b2dfdbc47210c40872988a31f1dd;p=thirdparty%2Fkernel%2Flinux.git crypto: hisilicon/sgl - remove unnecessary checks for curr_hw_sgl error Before calling acc_get_sgl(), the mem_block has already been created. acc_get_sgl() will not return NULL or any other error. so the return value check can be removed. Signed-off-by: nieweiqiang Signed-off-by: Chenghai Huang Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/hisilicon/sgl.c b/drivers/crypto/hisilicon/sgl.c index 7a9ef2a9972a2..24c7b6ab285ba 100644 --- a/drivers/crypto/hisilicon/sgl.c +++ b/drivers/crypto/hisilicon/sgl.c @@ -245,11 +245,6 @@ hisi_acc_sg_buf_map_to_hw_sgl(struct device *dev, struct scatterlist *sgl, } curr_hw_sgl = acc_get_sgl(pool, index, &curr_sgl_dma); - if (IS_ERR(curr_hw_sgl)) { - dev_err(dev, "Get SGL error!\n"); - ret = -ENOMEM; - goto err_unmap; - } curr_hw_sgl->entry_length_in_sgl = cpu_to_le16(pool->sge_nr); curr_hw_sge = curr_hw_sgl->sge_entries;