From 86e851e1e263c79f19eb9db52553de99f19b8bb9 Mon Sep 17 00:00:00 2001 From: Spencer Oliver Date: Sat, 29 May 2010 15:43:42 +0100 Subject: nor: fix memory leaks during probe Fix similar memory leaks as per commit: ef72484b785ec7462a0415afea679d08b864c7fb Signed-off-by: Spencer Oliver --- src/flash/nor/tms470.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/flash/nor/tms470.c') diff --git a/src/flash/nor/tms470.c b/src/flash/nor/tms470.c index c1681f19..343c43ed 100644 --- a/src/flash/nor/tms470.c +++ b/src/flash/nor/tms470.c @@ -139,6 +139,12 @@ static int tms470_read_part_info(struct flash_bank *bank) rom_flash = (device_ident_reg >> 10) & 1; part_number = (device_ident_reg >> 3) & 0x7f; + if (bank->sectors) + { + free(bank->sectors); + bank->sectors = NULL; + } + /* * If the part number is known, determine if the flash bank is valid * based on the base address being within the known flash bank -- cgit v1.2.3