Skip to contentSkip to conversation

ubi: Ensure no fastmap flush after uif_close

PATCH New Martin Townsend 2 participants 2 messages Jan 18, 2018 – Feb 6, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ubi: Ensure no fastmap flush after uif_close

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.

Cc hs at denx.de
Cc kmpark at infradead.org
Cc richard at 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(-)
drivers/mtd/ubi/fastmap-wl.c +0 -5
index a33d406..b7876a8 100644
@@ -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);
 
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/1 ubi: Ensure no fastmap flush after uif_close

Hello Martin,

Am 18.01.2018 um 09:07 schrieb Martin Townsend:

Quoted 8 lines

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.

Cc hs at denx.de
Cc kmpark at infradead.org
Cc richard at sigma-star.at
Quoted 7 lines

---
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

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de