lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Wed, 26 Jul 2023 09:33:30 +0000
From:   Li Zetao <lizetao1@...wei.com>
To:     <tytso@....edu>, <adilger.kernel@...ger.ca>
CC:     <lizetao1@...wei.com>, <linux-ext4@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
Subject: [PATCH -next] ext4: NULL check before some freeing functions is not needed

Fix below warnings reported by coccicheck:
fs/ext4/super.c:2472:4-9: WARNING: NULL check before some freeing functions is not needed.
fs/ext4/super.c:2057:2-7: WARNING: NULL check before some freeing functions is not needed.

Signed-off-by: Li Zetao <lizetao1@...wei.com>
---
 fs/ext4/super.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index b54c70e1a74e..27d5aea1f715 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2053,9 +2053,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;
 	ctx->spec |= EXT4_SPEC_JQUOTA;
@@ -2468,8 +2466,7 @@ static int parse_options(struct fs_context *fc, char *options)
 			param.size = v_len;
 
 			ret = ext4_parse_param(fc, &param);
-			if (param.string)
-				kfree(param.string);
+			kfree(param.string);
 			if (ret < 0)
 				return ret;
 		}
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ