From: Marcin Slusarz Date: Wed, 13 Feb 2008 23:03:33 +0000 (-0800) Subject: udf: fix udf_add_free_space X-Git-Tag: v2.6.25-rc2~51 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cba44359d15ac7a3bca2c9199b7ff403d7edc69e;p=linux-2.6 udf: fix udf_add_free_space 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 Cc: Jan Kara Acked-by: Cyrill Gorcunov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c index d721a1af19..f855dcbbdf 100644 --- a/fs/udf/balloc.c +++ b/fs/udf/balloc.c @@ -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;