[PATCH] crypto: marvell/octeontx - remove redundant NULL check

zys.zljxml@gmail.com posted 1 patch 3 years, 4 months ago
drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[PATCH] crypto: marvell/octeontx - remove redundant NULL check
Posted by zys.zljxml@gmail.com 3 years, 4 months ago
From: Yushan Zhou <katrinzhou@tencent.com>

release_firmware() checks whether firmware pointer is NULL. Remove the redundant NULL check in release_tar_archive().

Signed-off-by: Yushan Zhou <katrinzhou@tencent.com>
---
 drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c b/drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c
index df9c2b8747e6..c4250e5fcf8f 100644
--- a/drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c
+++ b/drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c
@@ -345,8 +345,7 @@ static void release_tar_archive(struct tar_arch_info_t *tar_arch)
 		kfree(curr);
 	}
 
-	if (tar_arch->fw)
-		release_firmware(tar_arch->fw);
+	release_firmware(tar_arch->fw);
 	kfree(tar_arch);
 }
 
-- 
2.27.0
Re: [PATCH] crypto: marvell/octeontx - remove redundant NULL check
Posted by Herbert Xu 3 years, 4 months ago
On Tue, Nov 22, 2022 at 03:49:00PM +0800, zys.zljxml@gmail.com wrote:
> From: Yushan Zhou <katrinzhou@tencent.com>
> 
> release_firmware() checks whether firmware pointer is NULL. Remove the redundant NULL check in release_tar_archive().
> 
> Signed-off-by: Yushan Zhou <katrinzhou@tencent.com>
> ---
>  drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

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