All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tee: optee: smc: remove unnecessary NULL check before release_firmware()
@ 2025-04-10  7:56 ` Chen Ni
  0 siblings, 0 replies; 6+ messages in thread
From: Chen Ni @ 2025-04-10  7:56 UTC (permalink / raw)
  To: op-tee

[-- Attachment #1: Type: text/plain, Size: 668 bytes --]

release_firmware() checks for NULL pointers internally.
Remove unneeded NULL check for fmw here.

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
---
 drivers/tee/optee/smc_abi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tee/optee/smc_abi.c b/drivers/tee/optee/smc_abi.c
index f0c3ac1103bb..26f8f7bbbe56 100644
--- a/drivers/tee/optee/smc_abi.c
+++ b/drivers/tee/optee/smc_abi.c
@@ -1551,8 +1551,7 @@ static int optee_load_fw(struct platform_device *pdev,
 		  data_pa_high, data_pa_low, 0, 0, 0, &res);
 	if (!rc)
 		rc = res.a0;
-	if (fw)
-		release_firmware(fw);
+	release_firmware(fw);
 	kfree(data_buf);
 
 	if (!rc) {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-04-28  5:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-10  7:56 [PATCH] tee: optee: smc: remove unnecessary NULL check before release_firmware() Chen Ni
2025-04-10  7:56 ` Chen Ni
2025-04-24  4:53 ` Sumit Garg
2025-04-24  4:53   ` Sumit Garg
2025-04-28  5:36   ` Jens Wiklander
2025-04-28  5:36     ` Jens Wiklander

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.