On Fri, Dec 20, 2019 at 10:14:49AM +0800, Hou Tao wrote: > 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. > > And also don't generate the initial fm_anchor when fastmap is disabled. I think this part deserves an extra patch. Otherwise the changes look good to me, so: Reviewed-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/