[PATCH v2] crypto: hisilicon/qm - cleanup warning in qm_vf_read_qos

Kai Ye posted 1 patch 4 years, 5 months ago
drivers/crypto/hisilicon/qm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH v2] crypto: hisilicon/qm - cleanup warning in qm_vf_read_qos
Posted by Kai Ye 4 years, 5 months ago
The kernel test rebot report this warning: Uninitialized variable: ret.
The code flow may return value of ret directly. This value is an
uninitialized variable, here is fix it.

Signed-off-by: Kai Ye <yekai13@huawei.com>
---
changes v1->v2:
	modfiy the comments.

 drivers/crypto/hisilicon/qm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c
index c5b84a5ea350..3b29c8993b8c 100644
--- a/drivers/crypto/hisilicon/qm.c
+++ b/drivers/crypto/hisilicon/qm.c
@@ -4295,7 +4295,7 @@ static void qm_vf_get_qos(struct hisi_qm *qm, u32 fun_num)
 static int qm_vf_read_qos(struct hisi_qm *qm)
 {
 	int cnt = 0;
-	int ret;
+	int ret = -EINVAL;
 
 	/* reset mailbox qos val */
 	qm->mb_qos = 0;
-- 
2.33.0

Re: [PATCH v2] crypto: hisilicon/qm - cleanup warning in qm_vf_read_qos
Posted by Herbert Xu 4 years, 5 months ago
On Sat, Jan 22, 2022 at 05:30:42PM +0800, Kai Ye wrote:
> The kernel test rebot report this warning: Uninitialized variable: ret.
> The code flow may return value of ret directly. This value is an
> uninitialized variable, here is fix it.
> 
> Signed-off-by: Kai Ye <yekai13@huawei.com>
> ---
> changes v1->v2:
> 	modfiy the comments.
> 
>  drivers/crypto/hisilicon/qm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt