ubi: fastmap: Return error code if memory allocation fails in add_aeb()
authorZhihao Cheng <chengzhihao1@huawei.com>
Mon, 27 Dec 2021 03:22:42 +0000 (11:22 +0800)
committerRichard Weinberger <richard@nod.at>
Mon, 10 Jan 2022 22:09:08 +0000 (23:09 +0100)
commitc3c07fc25f37c157fde041b3a0c3dfcb1590cbce
tree6d847f606237b5dce6fd82ad9aaa4233e2c1b20a
parent3b67db8a6ca83e6ff90b756d3da0c966f61cd37b
ubi: fastmap: Return error code if memory allocation fails in add_aeb()

Abort fastmap scanning and return error code if memory allocation fails
in add_aeb(). Otherwise ubi will get wrong peb statistics information
after scanning.

Fixes: dbb7d2a88d2a7b ("UBI: Add fastmap core")
Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
drivers/mtd/ubi/fastmap.c