Skip to content

Commit 766f44d

Browse files
vmartirosyantytso
authored andcommitted
ext4: fixed potential NULL dereference in ext4_calculate_overhead()
The memset operation before check can cause a BUG if the memory allocation failed. Since we are using get_zeroed_age, there is no need to use memset anyway. Found by the Spruce system in cooperation with the KEDR Framework. Signed-off-by: Vahram Martirosyan <[email protected]> Signed-off-by: "Theodore Ts'o" <[email protected]>
1 parent 0634867 commit 766f44d

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

fs/ext4/super.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3206,7 +3206,6 @@ int ext4_calculate_overhead(struct super_block *sb)
32063206
ext4_fsblk_t overhead = 0;
32073207
char *buf = (char *) get_zeroed_page(GFP_KERNEL);
32083208

3209-
memset(buf, 0, PAGE_SIZE);
32103209
if (!buf)
32113210
return -ENOMEM;
32123211

0 commit comments

Comments
 (0)