diff options
author | Vahram Martirosyan <vmartirosyan@gmail.com> | 2012-11-28 12:44:16 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2012-11-28 12:44:16 -0500 |
commit | 766f44d46a726cb59f52a75c5c87425a10c4bade (patch) | |
tree | 33aa0c54b0ad7dd3aa6036f4a6351827275286f1 /fs/ext4 | |
parent | 06348679c9f69b3b031cf84c1f5f9f2488fc1f7d (diff) |
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 <vmartirosyan@linuxtesting.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/super.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index ad6cd8aeb946..66a4e20424cf 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -3206,7 +3206,6 @@ int ext4_calculate_overhead(struct super_block *sb) | |||
3206 | ext4_fsblk_t overhead = 0; | 3206 | ext4_fsblk_t overhead = 0; |
3207 | char *buf = (char *) get_zeroed_page(GFP_KERNEL); | 3207 | char *buf = (char *) get_zeroed_page(GFP_KERNEL); |
3208 | 3208 | ||
3209 | memset(buf, 0, PAGE_SIZE); | ||
3210 | if (!buf) | 3209 | if (!buf) |
3211 | return -ENOMEM; | 3210 | return -ENOMEM; |
3212 | 3211 | ||