mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 15:14:43 +00:00
env: superfluous check before free()
Free() checks if its argument in NULL. There is no need for the caller to do the same. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
This commit is contained in:
parent
73d18e352d
commit
28ab12ad14
1 changed files with 2 additions and 4 deletions
6
env/flash.c
vendored
6
env/flash.c
vendored
|
@ -210,8 +210,7 @@ static int env_flash_save(void)
|
|||
perror:
|
||||
flash_perror(rc);
|
||||
done:
|
||||
if (saved_data)
|
||||
free(saved_data);
|
||||
free(saved_data);
|
||||
/* try to re-protect */
|
||||
flash_sect_protect(1, (ulong)flash_addr, end_addr);
|
||||
flash_sect_protect(1, (ulong)flash_addr_new, end_addr_new);
|
||||
|
@ -298,8 +297,7 @@ static int env_flash_save(void)
|
|||
perror:
|
||||
flash_perror(rc);
|
||||
done:
|
||||
if (saved_data)
|
||||
free(saved_data);
|
||||
free(saved_data);
|
||||
/* try to re-protect */
|
||||
flash_sect_protect(1, (long)flash_addr, end_addr);
|
||||
return rc;
|
||||
|
|
Loading…
Reference in a new issue