diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index 42b0295465b4..1c74a7cbf5b1 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c @@ -315,6 +315,9 @@ static struct dentry *start_creating(const char *name, struct dentry *parent) struct dentry *dentry; int error; + if (!debugfs_initialized()) + return ERR_PTR(-ENOENT); + pr_debug("creating file '%s'\n", name); if (IS_ERR(parent))