diff options
author | Thorsten Blum <thorsten.blum@toblux.com> | 2024-03-17 16:36:39 +0100 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2024-05-02 14:44:51 -0400 |
commit | ea7d09ad7c280122a322f408672ab8d75c1a0e30 (patch) | |
tree | 650e70765063bea4ad4a090e9a9156f93c885031 /fs/ext4 | |
parent | a0c7cce824a54dbb83bb722df19f1ddcfa5f8d25 (diff) |
ext4: remove unneeded if checks before kfree
kfree already checks if its argument is NULL. This fixes two
Coccinelle/coccicheck warnings reported by ifnullfree.cocci.
Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Link: https://lore.kernel.org/r/20240317153638.2136-2-thorsten.blum@toblux.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/super.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 044135796f2b..28cbe0f1996f 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -2078,8 +2078,7 @@ static int unnote_qf_name(struct fs_context *fc, int qtype) { struct ext4_fs_context *ctx = fc->fs_private; - if (ctx->s_qf_names[qtype]) - kfree(ctx->s_qf_names[qtype]); + kfree(ctx->s_qf_names[qtype]); ctx->s_qf_names[qtype] = NULL; ctx->qname_spec |= 1 << qtype; @@ -2484,8 +2483,7 @@ static int parse_options(struct fs_context *fc, char *options) param.size = v_len; ret = ext4_parse_param(fc, ¶m); - if (param.string) - kfree(param.string); + kfree(param.string); if (ret < 0) return ret; } |