Fixed segfault in yaffs_guts
authorTimothy Manning <codedraftsman@gmail.com>
Thu, 24 Jun 2021 02:39:00 +0000 (14:39 +1200)
committerTimothy Manning <codedraftsman@gmail.com>
Thu, 1 Jul 2021 02:36:33 +0000 (14:36 +1200)
Remounting a device would cause a segfault because the
device's temp_buffer would not be reinitialised. Resulting
in a null pointer being called as a function, creating the segfault.

Signed-off-by: Timothy Manning <codedraftsman@gmail.com>
yaffs_guts.c

index a2b4cdf696114a2d89ab639c1ab0f35ee126221b..4621dfa2117b33fc78abb105c389246074551b9c 100644 (file)
@@ -163,6 +163,8 @@ u8 *yaffs_get_temp_buffer(struct yaffs_dev * dev)
 
 }
 
+/* Frees all the temp_buffer objects in the yaffs_dev instance
+*/
 void yaffs_release_temp_buffer(struct yaffs_dev *dev, u8 *buffer)
 {
        int i;
@@ -4826,6 +4828,7 @@ void yaffs_deinitialise(struct yaffs_dev *dev)
                kfree(dev->checkpt_block_list);
                dev->checkpt_block_list = NULL;
 
+               dev->ll_init = 0;
                dev->is_mounted = 0;
 
                yaffs_deinit_nand(dev);