Skip to content

Commit

Permalink
udf: fix udf_add_free_space
Browse files Browse the repository at this point in the history
In commit 742ba02 (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>
  • Loading branch information
Marcin Slusarz authored and Linus Torvalds committed Feb 14, 2008
1 parent e28d80f commit cba4435
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/udf/balloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit cba4435

Please sign in to comment.