From: Richard Weinberger Date: Fri, 26 Sep 2014 21:08:15 +0000 (+0200) Subject: UBI: Fastmap: Ensure that all fastmap work is done upon WL shutdown X-Git-Tag: v4.1-rc1~122^2~38 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=399a9feeac83c2f64138c438e41222a12dd71766;p=karo-tx-linux.git UBI: Fastmap: Ensure that all fastmap work is done upon WL shutdown ...otherwise the deferred work might run after datastructures got freed and corrupt memory. Signed-off-by: Richard Weinberger Reviewed-by: Guido Martínez --- 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;