Skip to content

Commit ea7d09a

Browse files
tobluxtytso
authored andcommitted
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>
1 parent a0c7cce commit ea7d09a

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

fs/ext4/super.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2078,8 +2078,7 @@ static int unnote_qf_name(struct fs_context *fc, int qtype)
20782078
{
20792079
struct ext4_fs_context *ctx = fc->fs_private;
20802080

2081-
if (ctx->s_qf_names[qtype])
2082-
kfree(ctx->s_qf_names[qtype]);
2081+
kfree(ctx->s_qf_names[qtype]);
20832082

20842083
ctx->s_qf_names[qtype] = NULL;
20852084
ctx->qname_spec |= 1 << qtype;
@@ -2484,8 +2483,7 @@ static int parse_options(struct fs_context *fc, char *options)
24842483
param.size = v_len;
24852484

24862485
ret = ext4_parse_param(fc, &param);
2487-
if (param.string)
2488-
kfree(param.string);
2486+
kfree(param.string);
24892487
if (ret < 0)
24902488
return ret;
24912489
}

0 commit comments

Comments
 (0)