nor: fix memory leaks during probe
Fix similar memory leaks as per commit:
ef72484b78
Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user