提交 cba44359 编写于 作者: M Marcin Slusarz 提交者: 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: NMarcin Slusarz <marcin.slusarz@gmail.com>
Cc: Jan Kara <jack@suse.cz>
Acked-by: NCyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册