aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorMarcin Slusarz <marcin.slusarz@gmail.com>2008-02-13 18:03:33 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-13 19:21:20 -0500
commitcba44359d15ac7a3bca2c9199b7ff403d7edc69e (patch)
tree1b6cad898e24a4f4409e478a9a7f538125f9407d /fs
parente28d80f18211e5d49e450ba0f07b8fdca6dfb83b (diff)
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 <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>
Diffstat (limited to 'fs')
-rw-r--r--fs/udf/balloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c
index d721a1af1972..f855dcbbdfb8 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,
145{ 145{
146 struct logicalVolIntegrityDesc *lvid; 146 struct logicalVolIntegrityDesc *lvid;
147 147
148 if (sbi->s_lvid_bh) 148 if (sbi->s_lvid_bh == NULL)
149 return false; 149 return false;
150 150
151 lvid = (struct logicalVolIntegrityDesc *)sbi->s_lvid_bh->b_data; 151 lvid = (struct logicalVolIntegrityDesc *)sbi->s_lvid_bh->b_data;