summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorRichard Weinberger2014-09-26 23:08:15 +0200
committerRichard Weinberger2015-03-26 19:31:26 +0100
commit399a9feeac83c2f64138c438e41222a12dd71766 (patch)
treeeefbdfbc60f05d0224f7c41924aff270665eca36 /drivers/mtd
parentUBI: Fastmap: Ensure that only one fastmap work is scheduled (diff)
downloadkernel-qcow2-linux-399a9feeac83c2f64138c438e41222a12dd71766.tar.gz
kernel-qcow2-linux-399a9feeac83c2f64138c438e41222a12dd71766.tar.xz
kernel-qcow2-linux-399a9feeac83c2f64138c438e41222a12dd71766.zip
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 <richard@nod.at> Reviewed-by: Guido Martínez <guido@vanguardiasur.com.ar>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/ubi/wl.c3
1 files changed, 3 insertions, 0 deletions
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;