lkml.org 
[lkml]   [2008]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 41/49] ext4: Add multi block allocator for ext4
The latest version of the mballoc patch in the ext4dev git patch queue
has a potential uninitialized use: CC [M] fs/ext4/mballoc.o

fs/ext4/mballoc.c: In function ‘ext4_mb_free_blocks’:
fs/ext4/mballoc.c:4408: warning: ‘bitmap_bh’ may be used uninitialized in this function

There are 2 gotos which will call put_bh on a NULL bitmap_bh.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Index: linux-2.6.24-rc6-mm1/fs/ext4/mballoc.c
===================================================================
--- linux-2.6.24-rc6-mm1.orig/fs/ext4/mballoc.c
+++ linux-2.6.24-rc6-mm1/fs/ext4/mballoc.c
@@ -4405,7 +4405,7 @@ void ext4_mb_free_blocks(handle_t *handl
unsigned long block, unsigned long count,
int metadata, unsigned long *freed)
{
- struct buffer_head *bitmap_bh;
+ struct buffer_head *bitmap_bh = NULL;
struct super_block *sb = inode->i_sb;
struct ext4_allocation_context ac;
struct ext4_group_desc *gdp;
@@ -4546,7 +4546,8 @@ do_more:
}
sb->s_dirt = 1;
error_return:
- put_bh(bitmap_bh);
+ if (bitmap_bh)
+ put_bh(bitmap_bh);
ext4_std_error(sb, err);
return;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2008-01-28 19:49    [W:0.330 / U:1.600 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site