]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fs/ntfs3: Drop redundant NULL check
authorAndrey Vatoropin <a.vatoropin@crpt.ru>
Mon, 3 Mar 2025 09:13:56 +0000 (09:13 +0000)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Mon, 28 Apr 2025 09:17:08 +0000 (12:17 +0300)
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@crpt.ru>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3/fslog.c

index d0d530f4e2b95efa6f9cdc51b6328655304bdfc7..e69f623b2e4985e39e5f1572298607885a9c798e 100644 (file)
@@ -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;