diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 4bc47e5b5f29af38d601f699face0e1f16b31a9f..86a164f08a74a51399c2152799ec178c93902fa6 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -834,7 +834,7 @@ struct inode *cifs_root_iget(struct super_block *sb, unsigned long ino)
 						xid, NULL);
 
 	if (!inode)
-		return ERR_PTR(-ENOMEM);
+		return ERR_PTR(rc);
 
 #ifdef CONFIG_CIFS_FSCACHE
 	/* populate tcon->resource_id */