diff --git a/fs/hmdfs/main.c b/fs/hmdfs/main.c index d0a41061bb2f343317232f54e8a4d8255c1e5673..4ba5a84d9a3f718db541936804f2de74cf098403 100644 --- a/fs/hmdfs/main.c +++ b/fs/hmdfs/main.c @@ -954,6 +954,10 @@ static struct dentry *hmdfs_mount(struct file_system_type *fs_type, int flags, .dev_name = dev_name, .raw_data = raw_data, }; + + /* hmdfs needs a valid dev_name to get the lower_sb's metadata */ + if (!dev_name || !*dev_name) + return ERR_PTR(-EINVAL); return mount_nodev(fs_type, flags, &priv, hmdfs_fill_super); }