]> err.no Git - linux-2.6/commitdiff
udf: fix udf_add_free_space
authorMarcin Slusarz <marcin.slusarz@gmail.com>
Wed, 13 Feb 2008 23:03:33 +0000 (15:03 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 14 Feb 2008 00:21:20 +0000 (16:21 -0800)
In commit 742ba02a51c8d0bf5446b154531179760c1ed0a2 (udf: create common
function for changing free space counter) by accident I reversed safety
condition which lead to null pointer dereference in case of media error and
wrong counting of free space in normal situation

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: Jan Kara <jack@suse.cz>
Acked-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/udf/balloc.c

index d721a1af19721fc0202ba9985b1278a04871b039..f855dcbbdfb854e1704566ae0cebd187c656c45f 100644 (file)
@@ -145,7 +145,7 @@ static bool udf_add_free_space(struct udf_sb_info *sbi,
 {
        struct logicalVolIntegrityDesc *lvid;
 
-       if (sbi->s_lvid_bh)
+       if (sbi->s_lvid_bh == NULL)
                return false;
 
        lvid = (struct logicalVolIntegrityDesc *)sbi->s_lvid_bh->b_data;