aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2020-04-28 21:50:02 +0200
committerTom Rini <trini@konsulko.com>2020-05-01 11:34:01 -0400
commit4fb0f55fd294aca02407ef1def74a22612fa041b (patch)
tree16c5533da8b013587b5b2e781fc4bc0990809b68 /fs
parentb142d0ac1946701f4d592869c2d81e42afe2e294 (diff)
downloadu-boot-4fb0f55fd294aca02407ef1def74a22612fa041b.zip
u-boot-4fb0f55fd294aca02407ef1def74a22612fa041b.tar.gz
u-boot-4fb0f55fd294aca02407ef1def74a22612fa041b.tar.bz2
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/ext4_journal.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/fs/ext4/ext4_journal.c b/fs/ext4/ext4_journal.c
index f8524e5..0ceb73d 100644
--- a/fs/ext4/ext4_journal.c
+++ b/fs/ext4/ext4_journal.c
@@ -107,22 +107,18 @@ void ext4fs_free_journal(void)
for (i = 0; i < MAX_JOURNAL_ENTRIES; i++) {
if (dirty_block_ptr[i]->blknr == -1)
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++) {
if (journal_ptr[i]->blknr == -1)
break;
- if (journal_ptr[i]->buf)
- free(journal_ptr[i]->buf);
+ free(journal_ptr[i]->buf);
}
for (i = 0; i < MAX_JOURNAL_ENTRIES; i++) {
- if (journal_ptr[i])
- free(journal_ptr[i]);
- if (dirty_block_ptr[i])
- free(dirty_block_ptr[i]);
+ free(journal_ptr[i]);
+ free(dirty_block_ptr[i]);
}
gindex = 0;
gd_index = 0;
@@ -272,8 +268,7 @@ void ext4fs_free_revoke_blks(void)
struct revoke_blk_list *next_node = NULL;
while (tmp_node != NULL) {
- if (tmp_node->content)
- free(tmp_node->content);
+ free(tmp_node->content);
tmp_node = tmp_node->next;
}