Skip to content

Commit

Permalink
fs: Fix null pointer exception caused by async fs_unmount
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
cdesjardins authored and mmahadevan108 committed Nov 8, 2024
1 parent f781d7a commit 862af5e
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions subsys/fs/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 862af5e

Please sign in to comment.