mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-19 03:15:00 +00:00
fs: ext4: avoid NULL check before free()
free() checks if its argument is NULL. Don't duplicate this in the calling code. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
parent
b142d0ac19
commit
4fb0f55fd2
1 changed files with 5 additions and 10 deletions
|
@ -107,22 +107,18 @@ void ext4fs_free_journal(void)
|
||||||
for (i = 0; i < MAX_JOURNAL_ENTRIES; i++) {
|
for (i = 0; i < MAX_JOURNAL_ENTRIES; i++) {
|
||||||
if (dirty_block_ptr[i]->blknr == -1)
|
if (dirty_block_ptr[i]->blknr == -1)
|
||||||
break;
|
break;
|
||||||
if (dirty_block_ptr[i]->buf)
|
free(dirty_block_ptr[i]->buf);
|
||||||
free(dirty_block_ptr[i]->buf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < MAX_JOURNAL_ENTRIES; i++) {
|
for (i = 0; i < MAX_JOURNAL_ENTRIES; i++) {
|
||||||
if (journal_ptr[i]->blknr == -1)
|
if (journal_ptr[i]->blknr == -1)
|
||||||
break;
|
break;
|
||||||
if (journal_ptr[i]->buf)
|
free(journal_ptr[i]->buf);
|
||||||
free(journal_ptr[i]->buf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < MAX_JOURNAL_ENTRIES; i++) {
|
for (i = 0; i < MAX_JOURNAL_ENTRIES; i++) {
|
||||||
if (journal_ptr[i])
|
free(journal_ptr[i]);
|
||||||
free(journal_ptr[i]);
|
free(dirty_block_ptr[i]);
|
||||||
if (dirty_block_ptr[i])
|
|
||||||
free(dirty_block_ptr[i]);
|
|
||||||
}
|
}
|
||||||
gindex = 0;
|
gindex = 0;
|
||||||
gd_index = 0;
|
gd_index = 0;
|
||||||
|
@ -272,8 +268,7 @@ void ext4fs_free_revoke_blks(void)
|
||||||
struct revoke_blk_list *next_node = NULL;
|
struct revoke_blk_list *next_node = NULL;
|
||||||
|
|
||||||
while (tmp_node != NULL) {
|
while (tmp_node != NULL) {
|
||||||
if (tmp_node->content)
|
free(tmp_node->content);
|
||||||
free(tmp_node->content);
|
|
||||||
tmp_node = tmp_node->next;
|
tmp_node = tmp_node->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue