From: Ye Li Date: Mon, 3 Aug 2020 04:11:06 +0000 (-0700) Subject: imx: nandbcb: Fix resource leak X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=fc11dc112d1defef0091a3ba2b5785b00e502929;p=u-boot.git imx: nandbcb: Fix resource leak 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 Reviewed-by: Peng Fan Signed-off-by: Peng Fan --- 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);