]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfs: remove unnecessary NULL check before kvfree()
authorChen Ni <nichen@iscas.ac.cn>
Thu, 13 Mar 2025 03:28:59 +0000 (11:28 +0800)
committerCarlos Maiolino <cem@kernel.org>
Tue, 18 Mar 2025 13:24:13 +0000 (14:24 +0100)
Remove unnecessary NULL check before kvfree() reported by
Coccinelle/coccicheck and the semantic patch at
scripts/coccinelle/free/ifnullfree.cocci.

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_rtalloc.c

index 9a99629d7de438832bccf1562440f48defabc21a..3aa222ea9500c1479a750620540e8be193497928 100644 (file)
@@ -1212,8 +1212,7 @@ xfs_growfs_rtg(
                        goto out_error;
        }
 
-       if (old_rsum_cache)
-               kvfree(old_rsum_cache);
+       kvfree(old_rsum_cache);
        goto out_rele;
 
 out_error: