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.14-rc1~5586^2~38 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=399a9feeac83c2f64138c438e41222a12dd71766;p=platform%2Fkernel%2Flinux-rpi.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 ae174f4..bf66890 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;