Skip to content
Commit 3b185255 authored by Zhihao Cheng's avatar Zhihao Cheng Committed by Richard Weinberger
Browse files

ubi: fastmap: Don't produce the initial next anchor PEB when fastmap is disabled



Following process triggers a memleak caused by forgetting to release the
initial next anchor PEB (CONFIG_MTD_UBI_FASTMAP is disabled):
1. attach -> __erase_worker -> produce the initial next anchor PEB
2. detach -> ubi_fastmap_close (Do nothing, it should have released the
   initial next anchor PEB)

Don't produce the initial next anchor PEB in __erase_worker() when fastmap
is disabled.

Signed-off-by: default avatarZhihao Cheng <chengzhihao1@huawei.com>
Suggested-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
Fixes: f9c34bb5 ("ubi: Fix producing anchor PEBs")
Reported-by: default avatar <syzbot+d9aab50b1154e3d163f5@syzkaller.appspotmail.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent fcf44196
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment