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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Apr 2022 07:08:25 +0000 (09:08 +0200)
commit801d547fdee363b4eecb06e88fc32a55bfc93c55
tree833f2e3d4bd6a110dc850b1409d330d72803dd8f
parent7ebdd69e871c9e7a0891c9d6efb2c8d21ce2c083
ubi: fastmap: Return error code if memory allocation fails in add_aeb()

commit c3c07fc25f37c157fde041b3a0c3dfcb1590cbce upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mtd/ubi/fastmap.c