Commit ea7d09ad authored by Thorsten Blum's avatar Thorsten Blum Committed by Theodore Ts'o

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: default avatarThorsten Blum <thorsten.blum@toblux.com>
Reviewed-by: default avatarRitesh Harjani (IBM) <ritesh.list@gmail.com>
Link: https://lore.kernel.org/r/20240317153638.2136-2-thorsten.blum@toblux.comSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent a0c7cce8
...@@ -2078,8 +2078,7 @@ static int unnote_qf_name(struct fs_context *fc, int qtype) ...@@ -2078,8 +2078,7 @@ static int unnote_qf_name(struct fs_context *fc, int qtype)
{ {
struct ext4_fs_context *ctx = fc->fs_private; 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->s_qf_names[qtype] = NULL;
ctx->qname_spec |= 1 << qtype; ctx->qname_spec |= 1 << qtype;
...@@ -2484,8 +2483,7 @@ static int parse_options(struct fs_context *fc, char *options) ...@@ -2484,8 +2483,7 @@ static int parse_options(struct fs_context *fc, char *options)
param.size = v_len; param.size = v_len;
ret = ext4_parse_param(fc, &param); ret = ext4_parse_param(fc, &param);
if (param.string) kfree(param.string);
kfree(param.string);
if (ret < 0) if (ret < 0)
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment