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:
@@ -324,6 +324,12 @@ static int avrf_probe(struct flash_bank *bank)
|
||||
|
||||
if (avr_info != NULL)
|
||||
{
|
||||
if (bank->sectors)
|
||||
{
|
||||
free(bank->sectors);
|
||||
bank->sectors = NULL;
|
||||
}
|
||||
|
||||
// chip found
|
||||
bank->base = 0x00000000;
|
||||
bank->size = (avr_info->flash_page_size * avr_info->flash_page_num);
|
||||
|
||||
Reference in New Issue
Block a user