* [PATCH -next V2] xfs: remove unnecessary NULL check before kvfree()
@ 2025-03-13 3:28 Chen Ni
2025-03-13 6:30 ` Christoph Hellwig
2025-03-14 13:28 ` Carlos Maiolino
0 siblings, 2 replies; 3+ messages in thread
From: Chen Ni @ 2025-03-13 3:28 UTC (permalink / raw)
To: cem, djwong, hch; +Cc: linux-xfs, linux-kernel, Chen Ni, Carlos Maiolino
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>
---
Changelog:
v1 -> v2:
1. rebase it on top of for-next.
---
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 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:
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next V2] xfs: remove unnecessary NULL check before kvfree()
2025-03-13 3:28 [PATCH -next V2] xfs: remove unnecessary NULL check before kvfree() Chen Ni
@ 2025-03-13 6:30 ` Christoph Hellwig
2025-03-14 13:28 ` Carlos Maiolino
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2025-03-13 6:30 UTC (permalink / raw)
To: Chen Ni; +Cc: cem, djwong, linux-xfs, linux-kernel, Carlos Maiolino
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next V2] xfs: remove unnecessary NULL check before kvfree()
2025-03-13 3:28 [PATCH -next V2] xfs: remove unnecessary NULL check before kvfree() Chen Ni
2025-03-13 6:30 ` Christoph Hellwig
@ 2025-03-14 13:28 ` Carlos Maiolino
1 sibling, 0 replies; 3+ messages in thread
From: Carlos Maiolino @ 2025-03-14 13:28 UTC (permalink / raw)
To: djwong, hch, Chen Ni; +Cc: linux-xfs, linux-kernel, Carlos Maiolino
On Thu, 13 Mar 2025 11:28:59 +0800, Chen Ni wrote:
> Remove unnecessary NULL check before kvfree() reported by
> Coccinelle/coccicheck and the semantic patch at
> scripts/coccinelle/free/ifnullfree.cocci.
>
>
Applied to for-next, thanks!
[1/1] xfs: remove unnecessary NULL check before kvfree()
commit: ef0f5bd5dd6233dd7952cea93ad80f3d7e45ad85
Best regards,
--
Carlos Maiolino <cem@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-03-14 13:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-13 3:28 [PATCH -next V2] xfs: remove unnecessary NULL check before kvfree() Chen Ni
2025-03-13 6:30 ` Christoph Hellwig
2025-03-14 13:28 ` Carlos Maiolino
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox