提交 4b3e0a25 编写于 作者: R Richard Weinberger 提交者: Artem Bityutskiy

UBI: Call scan_all() with correct offset in error case

If we find an invalid fastmap we have to scan from the very beginning.
Otherwise we leak the first 64 PEBs.
Reported-and-tested-by: NRichard Genoud <richard.genoud@gmail.com>
Signed-off-by: NRichard Weinberger <richard@nod.at>
Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
上级 f240dca8
......@@ -1417,9 +1417,11 @@ int ubi_attach(struct ubi_device *ubi, int force_scan)
ai = alloc_ai("ubi_aeb_slab_cache2");
if (!ai)
return -ENOMEM;
}
err = scan_all(ubi, ai, UBI_FM_MAX_START);
err = scan_all(ubi, ai, 0);
} else {
err = scan_all(ubi, ai, UBI_FM_MAX_START);
}
}
}
#else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册