summaryrefslogtreecommitdiff
path: root/drivers/mtd/ubi/wl.c
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2014-09-27 01:08:15 +0400
committerRichard Weinberger <richard@nod.at>2015-03-26 21:31:26 +0300
commit399a9feeac83c2f64138c438e41222a12dd71766 (patch)
treeeefbdfbc60f05d0224f7c41924aff270665eca36 /drivers/mtd/ubi/wl.c
parent19371d73c9bd31a8e634ec5a80fc19fcd7714481 (diff)
downloadlinux-399a9feeac83c2f64138c438e41222a12dd71766.tar.xz
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/ubi/wl.c')
-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;