From: Longfang Liu liulongfang@huawei.com
Inside the asynchronous packet receiving interface of all submodules. When the number of expected received packets is 0. Failure to intercept will result in abnormal packet recycling. As a result, the number of normal service packets does not match.
In addition, when the expected value is 0, it will cause the while loop control adjustment to flip, resulting in other receiving operations.
Signed-off-by: Longfang Liu liulongfang@huawei.com --- wd_aead.c | 2 +- wd_cipher.c | 2 +- wd_comp.c | 4 ++-- wd_dh.c | 4 ++-- wd_digest.c | 2 +- wd_ecc.c | 4 ++-- wd_rsa.c | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/wd_aead.c b/wd_aead.c index 87d61c3..ff43086 100644 --- a/wd_aead.c +++ b/wd_aead.c @@ -816,7 +816,7 @@ int wd_aead_poll_ctx(__u32 idx, __u32 expt, __u32 *count) __u32 tmp = expt; int ret;
- if (unlikely(!count)) { + if (unlikely(!count || !expt)) { WD_ERR("invalid: aead poll ctx input param is NULL!\n"); return -WD_EINVAL; } diff --git a/wd_cipher.c b/wd_cipher.c index 58d34f7..0187c9c 100644 --- a/wd_cipher.c +++ b/wd_cipher.c @@ -730,7 +730,7 @@ int wd_cipher_poll_ctx(__u32 idx, __u32 expt, __u32 *count) __u32 tmp = expt; int ret;
- if (unlikely(!count)) { + if (unlikely(!count || !expt)) { WD_ERR("invalid: cipher poll ctx input param is NULL!\n"); return -WD_EINVAL; } diff --git a/wd_comp.c b/wd_comp.c index 6e71d35..cabd17f 100644 --- a/wd_comp.c +++ b/wd_comp.c @@ -340,8 +340,8 @@ int wd_comp_poll_ctx(__u32 idx, __u32 expt, __u32 *count) __u32 tmp = expt; int ret;
- if (unlikely(!count)) { - WD_ERR("invalid: comp poll count is 0!\n"); + if (unlikely(!count || !expt)) { + WD_ERR("invalid: comp poll count or expt is 0!\n"); return -WD_EINVAL; }
diff --git a/wd_dh.c b/wd_dh.c index 40a52e5..dac55ca 100644 --- a/wd_dh.c +++ b/wd_dh.c @@ -438,8 +438,8 @@ int wd_dh_poll_ctx(__u32 idx, __u32 expt, __u32 *count) __u32 tmp = expt; int ret;
- if (unlikely(!count)) { - WD_ERR("invalid: count is NULL!\n"); + if (unlikely(!count || !expt)) { + WD_ERR("invalid: dh poll count or expt is NULL!\n"); return -WD_EINVAL; }
diff --git a/wd_digest.c b/wd_digest.c index bc67878..1f2b3b2 100644 --- a/wd_digest.c +++ b/wd_digest.c @@ -701,7 +701,7 @@ int wd_digest_poll_ctx(__u32 idx, __u32 expt, __u32 *count) __u32 tmp = expt; int ret;
- if (unlikely(!count)) { + if (unlikely(!count || !expt)) { WD_ERR("invalid: digest poll ctx input param is NULL!\n"); return -WD_EINVAL; } diff --git a/wd_ecc.c b/wd_ecc.c index 4323e54..b5e7e36 100644 --- a/wd_ecc.c +++ b/wd_ecc.c @@ -2272,8 +2272,8 @@ int wd_ecc_poll_ctx(__u32 idx, __u32 expt, __u32 *count) __u32 tmp = expt; int ret;
- if (unlikely(!count)) { - WD_ERR("invalid: param count is NULL!\n"); + if (unlikely(!count || !expt)) { + WD_ERR("invalid: ecc poll param count or expt is NULL!\n"); return -WD_EINVAL; }
diff --git a/wd_rsa.c b/wd_rsa.c index 1813676..b71540f 100644 --- a/wd_rsa.c +++ b/wd_rsa.c @@ -495,8 +495,8 @@ int wd_rsa_poll_ctx(__u32 idx, __u32 expt, __u32 *count) __u32 tmp = expt; int ret;
- if (unlikely(!count)) { - WD_ERR("invalid: param count is NULL!\n"); + if (unlikely(!count || !expt)) { + WD_ERR("invalid: rsa poll count or expt is NULL!\n"); return -WD_EINVAL; }