linux/drivers/mtd/ubi
Hou Tao 7d3d6fc18c ubi: fastmap: Free unused fastmap anchor peb during detach
[ Upstream commit c16f39d14a ]

When CONFIG_MTD_UBI_FASTMAP is enabled, fm_anchor will be assigned
a free PEB during ubi_wl_init() or ubi_update_fastmap(). However
if fastmap is not used or disabled on the MTD device, ubi_wl_entry
related with the PEB will not be freed during detach.

So Fix it by freeing the unused fastmap anchor during detach.

Fixes: f9c34bb529 ("ubi: Fix producing anchor PEBs")
Reported-by: syzbot+f317896aae32eb281a58@syzkaller.appspotmail.com
Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Hou Tao <houtao1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-10-01 13:14:49 +02:00
..
attach.c UBI: introduce the VID buffer concept 2016-10-02 22:48:14 +02:00
block.c ubi: Fix error for write access 2018-04-04 23:48:05 +02:00
build.c ubi: Put MTD device after it is not used 2019-12-05 09:20:10 +01:00
cdev.c ubi: expose the volume CRC check skip flag 2018-08-15 00:25:21 +02:00
debug.c ubi: Fix seq_file usage in detailed_erase_block_info debugfs file 2020-05-27 17:37:30 +02:00
debug.h
eba.c treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
fastmap-wl.c ubi: fastmap: Free unused fastmap anchor peb during detach 2020-10-01 13:14:49 +02:00
fastmap.c ubi: Fix producing anchor PEBs 2020-10-01 13:14:28 +02:00
gluebi.c mtd: Stop updating erase_info->state and calling mtd_erase_callback() 2018-03-21 09:50:56 +01:00
io.c mtd: Unconditionally update ->fail_addr and ->addr in part_erase() 2018-03-15 18:22:26 +01:00
kapi.c ubi: Do not drop UBI device reference before using 2019-12-05 09:20:11 +01:00
Kconfig UBI: Fix typos 2017-03-24 15:33:32 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
misc.c
ubi-media.h ubi: provide a way to skip CRC checks 2018-08-15 00:25:20 +02:00
ubi.h ubi: Fix producing anchor PEBs 2020-10-01 13:14:28 +02:00
upd.c ubi/upd: Always flush after prepared for an update 2017-03-30 09:27:11 +02:00
vmt.c ubi: expose the volume CRC check skip flag 2018-08-15 00:25:21 +02:00
vtbl.c ubi: provide a way to skip CRC checks 2018-08-15 00:25:20 +02:00
wl.c ubi: Fix producing anchor PEBs 2020-10-01 13:14:28 +02:00
wl.h ubi: Fix producing anchor PEBs 2020-10-01 13:14:28 +02:00