x
diff --git a/kernel/inode.c b/kernel/inode.c
index b59a146..702ef57 100644
--- a/kernel/inode.c
+++ b/kernel/inode.c
@@ -182,6 +182,9 @@
 
         sb->u.generic_sbp = fc;
 	sb->s_root = d_alloc_root(root);
+	if(!sb->s_root)
+		goto err;
+
 	fc->sb = sb;
 	spin_unlock(&fuse_lock);