yaffs_guts.c : Fix missing temporary buffers when doing yaffs format on inband tags. master
authorCharles Manning <cdhmanning@gmail.com>
Sat, 15 May 2021 00:33:36 +0000 (12:33 +1200)
committerCharles Manning <cdhmanning@gmail.com>
Sat, 15 May 2021 00:33:36 +0000 (12:33 +1200)
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 <cdhmanning@gmail.com>
yaffs_guts.c

index ba7fc84..a2b4cdf 100644 (file)
@@ -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)