]> git.hungrycats.org Git - linux/commitdiff
[PATCH] reiserfs: cleanup_bitmap_list() check for NULL argument.
authorAndrew Morton <akpm@osdl.org>
Tue, 20 Jan 2004 11:16:29 +0000 (03:16 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Tue, 20 Jan 2004 11:16:29 +0000 (03:16 -0800)
From: Nikita Danilov <Nikita@Namesys.COM>

fs/reiserfs/journal.c:cleanup_bitmap_list() can be called to cleanup
reiserfs_list_bitmap that was only partly initialized. Check that
jb->bitmaps array was actually allocated, before trying to free its
elements.

fs/reiserfs/journal.c

index c86cd729e3a2343ffaf785021633785c3f897565..9e47beaf881a7084c9b0d1a669bc98b045a01241 100644 (file)
@@ -193,6 +193,9 @@ static int set_bit_in_list_bitmap(struct super_block *p_s_sb, int block,
 static void cleanup_bitmap_list(struct super_block *p_s_sb,
                                 struct reiserfs_list_bitmap *jb) {
   int i;
+  if (jb->bitmaps == NULL)
+    return;
+
   for (i = 0 ; i < SB_BMAP_NR(p_s_sb) ; i++) {
     if (jb->bitmaps[i]) {
       free_bitmap_node(p_s_sb, jb->bitmaps[i]) ;