Skip to content

Commit 862af5e

Browse files
cdesjardinsmmahadevan108
authored andcommitted
fs: Fix null pointer exception caused by async fs_unmount
The mp pointer is in fs_file_t and fs_dir_t so if the fs pointer is made NULL then subsequent file I/O operations will cause a NULL pointer exception. Removing the mount point from the list is threadsafe and should be sufficient. Signed-off-by: Chris Desjardins <[email protected]>
1 parent f781d7a commit 862af5e

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

subsys/fs/fs.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -815,9 +815,6 @@ int fs_unmount(struct fs_mount_t *mp)
815815
goto unmount_err;
816816
}
817817

818-
/* clear file system interface */
819-
mp->fs = NULL;
820-
821818
/* remove mount node from the list */
822819
sys_dlist_remove(&mp->node);
823820
LOG_DBG("fs unmounted from %s", mp->mnt_point);

0 commit comments

Comments
 (0)