From: Timothy Manning Date: Thu, 24 Jun 2021 02:39:00 +0000 (+1200) Subject: Fixed segfault in yaffs_guts X-Git-Url: https://yaffs.net/gitweb/?p=yaffs2.git;a=commitdiff_plain;h=794059997ab24f0ca4cab7587325da4bd9ddb108 Fixed segfault in yaffs_guts 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 --- diff --git a/yaffs_guts.c b/yaffs_guts.c index a2b4cdf..4621dfa 100644 --- a/yaffs_guts.c +++ b/yaffs_guts.c @@ -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);