From 43d34814bfdc29bb10c972299e670a784925e7dc Mon Sep 17 00:00:00 2001 From: Enrico Fraccaroli Date: Mon, 13 Dec 2021 21:10:17 +0100 Subject: [PATCH] Add check if the mount callback is set. --- mentos/src/fs/vfs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mentos/src/fs/vfs.c b/mentos/src/fs/vfs.c index 46b0516..0b11668 100644 --- a/mentos/src/fs/vfs.c +++ b/mentos/src/fs/vfs.c @@ -372,6 +372,10 @@ int do_mount(const char *type, const char *path, const char *args) pr_err("Unknown filesystem type: %s\n", type); return -ENODEV; } + if (fst->mount == NULL) { + pr_err("No mount callback set: %s\n", type); + return -ENODEV; + } vfs_file_t *file = fst->mount(path, args); if (file == NULL) { pr_err("Mount callback return a null pointer: %s\n", type);