[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250311071114.1037911-1-nichen@iscas.ac.cn>
Date: Tue, 11 Mar 2025 15:11:14 +0800
From: Chen Ni <nichen@...as.ac.cn>
To: cem@...nel.org,
djwong@...nel.org
Cc: linux-xfs@...r.kernel.org,
linux-kernel@...r.kernel.org,
Chen Ni <nichen@...as.ac.cn>
Subject: [PATCH] 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 <nichen@...as.ac.cn>
---
fs/xfs/xfs_rtalloc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
index 57bef567e011..9688e8ca6915 100644
--- a/fs/xfs/xfs_rtalloc.c
+++ b/fs/xfs/xfs_rtalloc.c
@@ -1144,8 +1144,7 @@ xfs_growfs_rtg(
goto out_error;
}
- if (old_rsum_cache)
- kvfree(old_rsum_cache);
+ kvfree(old_rsum_cache);
xfs_rtgroup_rele(rtg);
return 0;
--
2.25.1
Powered by blists - more mailing lists