From 399a9feeac83c2f64138c438e41222a12dd71766 Mon Sep 17 00:00:00 2001 From: Richard Weinberger Date: Fri, 26 Sep 2014 23:08:15 +0200 Subject: [PATCH] UBI: Fastmap: Ensure that all fastmap work is done upon WL shutdown MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ...otherwise the deferred work might run after datastructures got freed and corrupt memory. Signed-off-by: Richard Weinberger Reviewed-by: Guido Martínez --- drivers/mtd/ubi/wl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c index ae174f4ed674..bf66890fefad 100644 --- a/drivers/mtd/ubi/wl.c +++ b/drivers/mtd/ubi/wl.c @@ -1856,6 +1856,9 @@ int ubi_thread(void *u) */ static void shutdown_work(struct ubi_device *ubi) { +#ifdef CONFIG_MTD_UBI_FASTMAP + flush_work(&ubi->fm_work); +#endif while (!list_empty(&ubi->works)) { struct ubi_work *wrk; -- 2.11.0