diff mbox series

[U-Boot,v2] ubi: Ensure no fastmap flush after uif_close

Message ID 1516262853-8611-1-git-send-email-mtownsend1973@gmail.com
State Accepted
Commit 2d2d306f79e5ae090790fd380662f5407ccace11
Delegated to: Heiko Schocher
Headers show
Series [U-Boot,v2] ubi: Ensure no fastmap flush after uif_close | expand

Commit Message

Martin Townsend Jan. 18, 2018, 8:07 a.m. UTC
On detach UBI attempts to update fastmap after closing user interfaces
but at this point UBI volumes have already been free()'ed and fastmap
can no longer access these data structures.

Signed-off-by: Martin Townsend <mtownsend1973@gmail.com>
Cc: hs@denx.de
Cc: kmpark@infradead.org
Cc: richard@sigma-star.at
---
Changes for v2:
   - Fix by removing update to fastmap from ubi_fastmap_close instead
     of reordering uif_close and ubi_wl_close in ubi_detach_mtd_dev

 drivers/mtd/ubi/fastmap-wl.c | 5 -----
 1 file changed, 5 deletions(-)

Comments

Heiko Schocher Feb. 6, 2018, 2:02 p.m. UTC | #1
Hello Martin,

Am 18.01.2018 um 09:07 schrieb Martin Townsend:
> On detach UBI attempts to update fastmap after closing user interfaces
> but at this point UBI volumes have already been free()'ed and fastmap
> can no longer access these data structures.
> 
> Signed-off-by: Martin Townsend <mtownsend1973@gmail.com>
> Cc: hs@denx.de
> Cc: kmpark@infradead.org
> Cc: richard@sigma-star.at
> ---
> Changes for v2:
>     - Fix by removing update to fastmap from ubi_fastmap_close instead
>       of reordering uif_close and ubi_wl_close in ubi_detach_mtd_dev
> 
>   drivers/mtd/ubi/fastmap-wl.c | 5 -----
>   1 file changed, 5 deletions(-)

Applied to u-boot-ubi master

Thanks!

bye,
Heiko
diff mbox series

Patch

diff --git a/drivers/mtd/ubi/fastmap-wl.c b/drivers/mtd/ubi/fastmap-wl.c
index a33d406..b7876a8 100644
--- a/drivers/mtd/ubi/fastmap-wl.c
+++ b/drivers/mtd/ubi/fastmap-wl.c
@@ -337,11 +337,6 @@  static void ubi_fastmap_close(struct ubi_device *ubi)
 {
 	int i;
 
-#ifndef __UBOOT__
-	flush_work(&ubi->fm_work);
-#else
-	update_fastmap_work_fn(ubi);
-#endif
 	return_unused_pool_pebs(ubi, &ubi->fm_pool);
 	return_unused_pool_pebs(ubi, &ubi->fm_wl_pool);