From 862af5e90357233a11bea31565ad5f2d6fec44c8 Mon Sep 17 00:00:00 2001 From: Chris Desjardins Date: Thu, 30 May 2024 17:11:45 +0200 Subject: [PATCH] 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 --- subsys/fs/fs.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/subsys/fs/fs.c b/subsys/fs/fs.c index 6e8daeee287..37781535f32 100644 --- a/subsys/fs/fs.c +++ b/subsys/fs/fs.c @@ -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);