Skip to content

Commit d16ee85

Browse files
committed
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 b9c9426 commit d16ee85

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
@@ -791,9 +791,6 @@ int fs_unmount(struct fs_mount_t *mp)
791791
goto unmount_err;
792792
}
793793

794-
/* clear file system interface */
795-
mp->fs = NULL;
796-
797794
/* remove mount node from the list */
798795
sys_dlist_remove(&mp->node);
799796
LOG_DBG("fs unmounted from %s", mp->mnt_point);

0 commit comments

Comments
 (0)