UBI: Fastmap: Ensure that all fastmap work is done upon WL shutdown
authorRichard Weinberger <richard@nod.at>
Fri, 26 Sep 2014 21:08:15 +0000 (23:08 +0200)
committerRichard Weinberger <richard@nod.at>
Thu, 26 Mar 2015 18:31:26 +0000 (19:31 +0100)
...otherwise the deferred work might run after datastructures
got freed and corrupt memory.

Signed-off-by: Richard Weinberger <richard@nod.at>
Reviewed-by: Guido Martínez <guido@vanguardiasur.com.ar>
drivers/mtd/ubi/wl.c

index ae174f4ed674b20b2b90a3adeb9487f891b50c75..bf66890fefad430163e20a09cb0859dcc846352b 100644 (file)
@@ -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;