[PATCH 03/13] imx: nandbcb: Fix resource leak

Peng Fan (OSS) peng.fan at oss.nxp.com
Thu Jan 14 08:28:00 CET 2021


From: Ye Li <ye.li at nxp.com>

Fix Coverity Issue 9006655. In write_fcb, leak of memory to resource
"fcb_raw_page". Since we have initialized the "ret" to 0, should return
the value of ret.

Signed-off-by: Ye Li <ye.li at nxp.com>
Reviewed-by: Peng Fan <peng.fan at nxp.com>
Signed-off-by: Peng Fan <peng.fan at nxp.com>
---
 arch/arm/mach-imx/cmd_nandbcb.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arm/mach-imx/cmd_nandbcb.c b/arch/arm/mach-imx/cmd_nandbcb.c
index c01f6aea73..6e50471164 100644
--- a/arch/arm/mach-imx/cmd_nandbcb.c
+++ b/arch/arm/mach-imx/cmd_nandbcb.c
@@ -653,8 +653,6 @@ static int write_fcb(struct boot_config *boot_cfg, struct fcb_block *fcb)
 		off += g_boot_search_stride;
 	}
 
-	return 0;
-
 fcb_raw_page_err:
 	kfree(fcb_raw_page);
 
-- 
2.28.0



More information about the U-Boot mailing list