Commit cba44359 authored by Marcin Slusarz's avatar Marcin Slusarz Committed by Linus Torvalds

udf: fix udf_add_free_space

In commit 742ba02a (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: default avatarMarcin Slusarz <marcin.slusarz@gmail.com>
Cc: Jan Kara <jack@suse.cz>
Acked-by: default avatarCyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent e28d80f1
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment