From: Kemeng Shi Date: Tue, 20 Aug 2024 13:22:33 +0000 (+0800) Subject: ext4: remove unneeded NULL check of buffer_head in ext4_mark_inode_used() X-Git-Tag: v6.12-rc1~117^2~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7523a7ef099abe7b9a98c4c8f722fe40541c9723;p=thirdparty%2Fkernel%2Fstable.git ext4: remove unneeded NULL check of buffer_head in ext4_mark_inode_used() If gdp from ext4_get_group_desc() is not NULL, then returned group_desc_bh won't be NULL either. Remove check of group_desc_bh and only check returned gdp from ext4_get_group_desc() like how other callers do. Signed-off-by: Kemeng Shi Link: https://patch.msgid.link/20240820132234.2759926-7-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o --- diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index 0234f5e91d8d8..daacb9f0ef50a 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c @@ -772,7 +772,7 @@ int ext4_mark_inode_used(struct super_block *sb, int ino) } gdp = ext4_get_group_desc(sb, group, &group_desc_bh); - if (!gdp || !group_desc_bh) { + if (!gdp) { err = -EINVAL; goto out; }