]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
imx: nandbcb: Fix resource leak
authorYe Li <ye.li@nxp.com>
Mon, 3 Aug 2020 04:11:06 +0000 (21:11 -0700)
committerStefano Babic <sbabic@denx.de>
Sat, 23 Jan 2021 10:30:31 +0000 (11:30 +0100)
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@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
arch/arm/mach-imx/cmd_nandbcb.c

index c01f6aea73f51e7cfb1969f77d2e838366231234..6e5047116496ee2ee0a62516c10af1632b837ea3 100644 (file)
@@ -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);