From: Dan Carpenter <error27@gmail.com>
Date: Sat, 29 May 2010 09:42:19 +0000 (+0000)
Subject: Btrfs: btrfs_iget() returns ERR_PTR
X-Git-Tag: MMI-PSA29.97-13-9~23186^2~11
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4cbd1149fbcc351bdf08ab749867d157905d0d35;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git

Btrfs: btrfs_iget() returns ERR_PTR

btrfs_iget() returns an ERR_PTR() on failure and not null.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
---

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 9ea711430466..859ddaab5e02 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -392,8 +392,8 @@ setup_root:
 	location.offset = 0;
 
 	inode = btrfs_iget(sb, &location, new_root, &new);
-	if (!inode)
-		return ERR_PTR(-ENOMEM);
+	if (IS_ERR(inode))
+		return ERR_CAST(inode);
 
 	/*
 	 * If we're just mounting the root most subvol put the inode and return