[PATCH 02/13] nandbcb: Fix uninitialized variable

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


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

Fix Coverity Issue 9006654. In write_fcb, use of an uninitialized
variable "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, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/cmd_nandbcb.c b/arch/arm/mach-imx/cmd_nandbcb.c
index 44fc37695d..c01f6aea73 100644
--- a/arch/arm/mach-imx/cmd_nandbcb.c
+++ b/arch/arm/mach-imx/cmd_nandbcb.c
@@ -563,7 +563,7 @@ static int write_fcb(struct boot_config *boot_cfg, struct fcb_block *fcb)
 {
 	struct mtd_info *mtd;
 	void *fcb_raw_page = NULL;
-	int i, ret;
+	int i, ret = 0;
 	loff_t off;
 	size_t size;
 
-- 
2.28.0



More information about the U-Boot mailing list