From 75b7de562dc219d3600b77330450baf848e50a14 Mon Sep 17 00:00:00 2001
From: Alexander Viro <viro@www.linux.org.uk>
Date: Wed, 3 Mar 2004 21:23:16 -0800
Subject: [PATCH] [PATCH] d_alloc_root() fixes: hfs

 - inode leak on d_alloc_root() failure
---
 fs/hfs/super.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/hfs/super.c b/fs/hfs/super.c
index 86e02098ac4f..54654573f536 100644
--- a/fs/hfs/super.c
+++ b/fs/hfs/super.c
@@ -294,13 +294,15 @@ static int hfs_fill_super(struct super_block *sb, void *data, int silent)
 
 	sb->s_root = d_alloc_root(root_inode);
 	if (!sb->s_root)
-		goto bail_no_root;
+		goto bail_iput;
 
 	sb->s_root->d_op = &hfs_dentry_operations;
 
 	/* everything's okay */
 	return 0;
 
+bail_iput:
+	iput(root_inode);
 bail_no_root:
 	hfs_warn("hfs_fs: get root inode failed.\n");
 	hfs_mdb_put(sb);
-- 
2.30.9