[PATCH v1] ext4: Remove redundant NULL check after __GFP_NOFAIL

Baolin Liu posted 1 patch 1 month ago
fs/ext4/extents.c | 4 ----
1 file changed, 4 deletions(-)
[PATCH v1] ext4: Remove redundant NULL check after __GFP_NOFAIL
Posted by Baolin Liu 1 month ago
From: Baolin Liu <liubaolin@kylinos.cn>

Remove redundant NULL check after kcalloc() with GFP_NOFS | __GFP_NOFAIL.

Signed-off-by: Baolin Liu <liubaolin@kylinos.cn>
---
 fs/ext4/extents.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 2cf5759ba689..0bee702ca663 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -2944,10 +2944,6 @@ int ext4_ext_remove_space(struct inode *inode, ext4_lblk_t start,
 	} else {
 		path = kcalloc(depth + 1, sizeof(struct ext4_ext_path),
 			       GFP_NOFS | __GFP_NOFAIL);
-		if (path == NULL) {
-			ext4_journal_stop(handle);
-			return -ENOMEM;
-		}
 		path[0].p_maxdepth = path[0].p_depth = depth;
 		path[0].p_hdr = ext_inode_hdr(inode);
 		i = 0;
-- 
2.39.2
Re: [PATCH v1] ext4: Remove redundant NULL check after __GFP_NOFAIL
Posted by Theodore Ts'o 1 week, 3 days ago
On Tue, 06 Jan 2026 14:20:16 +0800, Baolin Liu wrote:
> Remove redundant NULL check after kcalloc() with GFP_NOFS | __GFP_NOFAIL.
> 
> 

Applied, thanks!

[1/1] ext4: Remove redundant NULL check after __GFP_NOFAIL
      commit: 591a4ab9b8b125bf72a345ca6f5c0ee4481db02b

Best regards,
-- 
Theodore Ts'o <tytso@mit.edu>