From: Alexey Khoroshilov <khoroshilov@ispras.ru>
Date: Thu, 23 Jun 2011 21:15:02 +0000 (+0400)
Subject: hfsplus: Fix double iput of the same inode in hfsplus_fill_super()
X-Git-Tag: firefly_0821_release~3680^2~5016^2~8
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=032016a56a1e9c83646435b32e4416d499e1f1ce;p=firefly-linux-kernel-4.4.55.git

hfsplus: Fix double iput of the same inode in hfsplus_fill_super()

There is a misprint in resource deallocation code on error path in
hfsplus_fill_super(): the sbi->alloc_file inode is iput twice,
while the root inode in not iput at all.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---

diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c
index b49b55584c84..84a47b709f51 100644
--- a/fs/hfsplus/super.c
+++ b/fs/hfsplus/super.c
@@ -500,7 +500,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
 out_put_hidden_dir:
 	iput(sbi->hidden_dir);
 out_put_root:
-	iput(sbi->alloc_file);
+	iput(root);
 out_put_alloc_file:
 	iput(sbi->alloc_file);
 out_close_cat_tree: