From ebbed01a137b01aaf6423eea1b739a957d8c9551 Mon Sep 17 00:00:00 2001 From: Charles Manning Date: Sat, 15 May 2021 12:33:36 +1200 Subject: [PATCH] yaffs_guts.c : Fix missing temporary buffers when doing yaffs format on inband tags. The low level init was not setting up temporary buffers. This was causing yaffs_format to crash in the case of formating a device with inband tags. Solution is to move the temporary buffer creation into low level init. Signed-off-by: Charles Manning --- yaffs_guts.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/yaffs_guts.c b/yaffs_guts.c index ba7fc84..a2b4cdf 100644 --- a/yaffs_guts.c +++ b/yaffs_guts.c @@ -4541,11 +4541,16 @@ int yaffs_guts_ll_init(struct yaffs_dev *dev) return YAFFS_FAIL; } + if (!yaffs_init_tmp_buffers(dev)) + return YAFFS_FAIL; + if (yaffs_init_nand(dev) != YAFFS_OK) { yaffs_trace(YAFFS_TRACE_ALWAYS, "InitialiseNAND failed"); return YAFFS_FAIL; } + dev->ll_init = 1; + return YAFFS_OK; } @@ -4692,10 +4697,7 @@ int yaffs_guts_initialise(struct yaffs_dev *dev) yaffs_endian_config(dev); - /* Initialise temporary buffers and caches. */ - if (!yaffs_init_tmp_buffers(dev)) - init_failed = 1; - + /* Initialise temporary caches. */ dev->gc_cleanup_list = NULL; if (!init_failed) -- 2.30.2