Add check if the mount callback is set.
This commit is contained in:
@@ -372,6 +372,10 @@ int do_mount(const char *type, const char *path, const char *args)
|
|||||||
pr_err("Unknown filesystem type: %s\n", type);
|
pr_err("Unknown filesystem type: %s\n", type);
|
||||||
return -ENODEV;
|
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);
|
vfs_file_t *file = fst->mount(path, args);
|
||||||
if (file == NULL) {
|
if (file == NULL) {
|
||||||
pr_err("Mount callback return a null pointer: %s\n", type);
|
pr_err("Mount callback return a null pointer: %s\n", type);
|
||||||
|
|||||||
Reference in New Issue
Block a user