
From: Zhushuai Yin <yinzhushuai@huawei.com> fix the issue in the code where variable accumulation might exceed u32, as well as some spelling errors. Signed-off-by: Zhushuai Yin <yinzhushuai@huawei.com> --- drv/hisi_qm_udrv.c | 2 +- drv/isa_ce_sm3.c | 2 +- wd_rsa.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drv/hisi_qm_udrv.c b/drv/hisi_qm_udrv.c index 304764e..70a6698 100644 --- a/drv/hisi_qm_udrv.c +++ b/drv/hisi_qm_udrv.c @@ -992,7 +992,7 @@ void hisi_qm_sgl_copy(void *pbuff, void *hw_sgl, __u32 offset, __u32 size, struct hisi_sgl *tmp = hw_sgl; int begin_sge = 0, i; __u32 sge_offset = 0; - __u32 len = 0; + __u64 len = 0; if (!pbuff || !size || !tmp) return; diff --git a/drv/isa_ce_sm3.c b/drv/isa_ce_sm3.c index 0e88b61..8d23061 100644 --- a/drv/isa_ce_sm3.c +++ b/drv/isa_ce_sm3.c @@ -386,7 +386,7 @@ static int sm3_ce_drv_init(struct wd_alg_driver *drv, void *conf) priv = malloc(sizeof(struct sm3_ce_drv_ctx)); if (!priv) - return -WD_EINVAL; + return -WD_ENOMEM; config->epoll_en = 0; memcpy(&priv->config, config, sizeof(struct wd_ctx_config_internal)); diff --git a/wd_rsa.c b/wd_rsa.c index 9fa01c5..4cb72fc 100644 --- a/wd_rsa.c +++ b/wd_rsa.c @@ -87,6 +87,7 @@ static void wd_rsa_close_driver(int init_type) #ifndef WD_STATIC_DRV if (init_type == WD_TYPE_V2) { wd_dlclose_drv(wd_rsa_setting.dlh_list); + wd_rsa_setting.dlh_list = NULL; return; } @@ -355,7 +356,6 @@ void wd_rsa_uninit2(void) wd_alg_attrs_uninit(&wd_rsa_init_attrs); wd_alg_drv_unbind(wd_rsa_setting.driver); wd_rsa_close_driver(WD_TYPE_V2); - wd_rsa_setting.dlh_list = NULL; wd_alg_clear_init(&wd_rsa_setting.status); } -- 2.33.0