From: Chen Ni Date: Thu, 13 Mar 2025 03:28:59 +0000 (+0800) Subject: xfs: remove unnecessary NULL check before kvfree() X-Git-Tag: v6.15-rc1~149^2~5 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=34ba1fcd74562b5a954e3fda5a303ab412682340;p=linux.git xfs: remove unnecessary NULL check before kvfree() 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 Reviewed-by: Carlos Maiolino Reviewed-by: Christoph Hellwig Signed-off-by: Carlos Maiolino --- diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c index 9a99629d7de4..3aa222ea9500 100644 --- a/fs/xfs/xfs_rtalloc.c +++ b/fs/xfs/xfs_rtalloc.c @@ -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: