[PATCH] ARM i.MX bbu: Fix wrong buffer free

Sascha Hauer s.hauer at pengutronix.de
Mon Dec 3 14:05:13 EST 2012


buf is still needed, instead mbr should be freed.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 arch/arm/mach-imx/imx-bbu-internal.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/imx-bbu-internal.c b/arch/arm/mach-imx/imx-bbu-internal.c
index c34f86f..a36a427 100644
--- a/arch/arm/mach-imx/imx-bbu-internal.c
+++ b/arch/arm/mach-imx/imx-bbu-internal.c
@@ -72,7 +72,7 @@ static int imx_bbu_write_device(struct imx_internal_bbu_handler *imx_handler,
 		}
 
 		memcpy(buf + 0x1b8, mbr + 0x1b8, 0x48);
-		free(buf);
+		free(mbr);
 
 		ret = lseek(fd, 0, SEEK_SET);
 		if (ret)
-- 
1.7.10.4




More information about the barebox mailing list