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 <chris@arch-embedded.com>
This commit is contained in:
Chris Desjardins 2024-05-30 17:11:45 +02:00 committed by Mahesh Mahadevan
parent f781d7a26f
commit 862af5e903
1 changed files with 0 additions and 3 deletions

View File

@ -815,9 +815,6 @@ int fs_unmount(struct fs_mount_t *mp)
goto unmount_err;
}
/* clear file system interface */
mp->fs = NULL;
/* remove mount node from the list */
sys_dlist_remove(&mp->node);
LOG_DBG("fs unmounted from %s", mp->mnt_point);