diff options
author | Spencer Oliver <ntfreak@users.sourceforge.net> | 2010-05-29 15:43:42 +0100 |
---|---|---|
committer | Spencer Oliver <ntfreak@users.sourceforge.net> | 2010-05-29 15:43:42 +0100 |
commit | 86e851e1e263c79f19eb9db52553de99f19b8bb9 (patch) | |
tree | f27ce597e5d63329677f4f5967beb0437350452d /src/flash/nor/stm32x.c | |
parent | 215353ef67434e41b13f8948dc7dceefc110e3fe (diff) |
nor: fix memory leaks during probe
Fix similar memory leaks as per commit:
ef72484b785ec7462a0415afea679d08b864c7fb
Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
Diffstat (limited to 'src/flash/nor/stm32x.c')
-rw-r--r-- | src/flash/nor/stm32x.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/flash/nor/stm32x.c b/src/flash/nor/stm32x.c index d11a8edc..8a3b8323 100644 --- a/src/flash/nor/stm32x.c +++ b/src/flash/nor/stm32x.c @@ -775,6 +775,12 @@ static int stm32x_probe(struct flash_bank *bank) /* calculate numbers of pages */ num_pages /= (page_size / 1024); + if (bank->sectors) + { + free(bank->sectors); + bank->sectors = NULL; + } + bank->base = 0x08000000; bank->size = (num_pages * page_size); bank->num_sectors = num_pages; |