[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250303091321.68634-1-a.vatoropin@crpt.ru>
Date: Mon, 3 Mar 2025 09:13:56 +0000
From: Ваторопин Андрей <a.vatoropin@...t.ru>
To: Konstantin Komarov <almaz.alexandrovich@...agon-software.com>
CC: Ваторопин Андрей <a.vatoropin@...t.ru>,
"ntfs3@...ts.linux.dev" <ntfs3@...ts.linux.dev>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"lvc-project@...uxtesting.org" <lvc-project@...uxtesting.org>
Subject: [PATCH] fs/ntfs3: Drop redundant NULL check
From: Andrey Vatoropin <a.vatoropin@...t.ru>
Static analysis shows that pointer "mi" cannot be NULL, since it is
pre-initialized above. A potential failure when mi equals NULL is
processed.
Remove the extra NULL check. It is meaningless and harms the readability
of the code, since before that the pointer is unconditionally
dereferenced.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Andrey Vatoropin <a.vatoropin@...t.ru>
---
fs/ntfs3/fslog.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ntfs3/fslog.c b/fs/ntfs3/fslog.c
index d0d530f4e2b9..03f3292fa987 100644
--- a/fs/ntfs3/fslog.c
+++ b/fs/ntfs3/fslog.c
@@ -3143,7 +3143,7 @@ static int do_action(struct ntfs_log *log, struct OPEN_ATTR_ENRTY *oe,
if (inode)
iput(inode);
- else if (mi)
+ else
mi_put(mi);
inode = inode_parent;
--
2.43.0
Powered by blists - more mailing lists