Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3387569ybp; Sun, 6 Oct 2019 10:49:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqyfzSFXdYSq7FJUJn2VEco1R4ExyVtzG9YnB3NHhoVCnj7B7EIYt2rY9QgjEGpCWBqhLEz8 X-Received: by 2002:a50:af26:: with SMTP id g35mr26011302edd.129.1570384159418; Sun, 06 Oct 2019 10:49:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570384159; cv=none; d=google.com; s=arc-20160816; b=rJytSyS0X0r8ZFVIj/lQiq8B5qAQeFABdo20gneixK8RUDF6sfEtETdP8wB/Fkng/h dpvsvu/+MBUbk7XOVjupzkSLYWgxWzjJy1kfNCHg9ibseYKDBjOzCQSoEPQ5CwzgyN4Y jxE6mMIHeg4ZUapmzmzILUqe1Pnh9hsajWh2MpdPCdUeiHGRDWT6u23BpyXWVkIvXGPR unW8JevKBhp50qsiOss8vjThZlpEZWFlBxlo83iroLZwri9kLnnRxYKUZEUeLgB6kY6K Nb09hkPfT0SyrH4liipDcjcB0um8HbTctqeyC5OfdouBqBwoGtoTB6JEyEhPW/iWSYeJ AHIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=++WYGxS3ngmr6cXgBTWLcujp1CB7l+w962tb2Mn6EZQ=; b=pG1raJpo1Vtw/4UCY5qJIbG683JTo6J0PmtV9iCPCuouf1NJfnws68FMTAT9PQdFYz 2n3XWgD62B5u/ZSOe18bhhR8JFQg46bc+wmjxwiiH3nH/U4BwX6iOdvYwO4b4rAo4Qxi ensT7nf/aJAmGiwgDcixbxgWQzciYcWYEc8TRqBMaoTyi7mXCV9K5kDK6kOGYDourgt4 DQDhKHMQ4T5NGeRoZct+9/mSMnMDsCDlty/OErZ/bOJML0RUn8wfWTKQFc9WPr1VtRgw RefzpefFihOk5STGbJlbtvPsV7zNqUprSBTR9t9eK3g1DT51T0sIyVp4/6xfTEY2r6r+ w5rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NZvYQ+xd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g31si7690393eda.399.2019.10.06.10.48.55; Sun, 06 Oct 2019 10:49:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NZvYQ+xd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728301AbfJFRoP (ORCPT + 99 others); Sun, 6 Oct 2019 13:44:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:44304 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731624AbfJFRoK (ORCPT ); Sun, 6 Oct 2019 13:44:10 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A78F220700; Sun, 6 Oct 2019 17:44:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570383849; bh=9DqCLIXw3OgaPQz/yyOp5nMdkQ0mojVShjTJc+3CrmU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NZvYQ+xd7yNiV+cJZdpdZjqaEN0nILK2/a32FYsI3ugUHTDDTwPjNfA9VlbZ7dswZ ag0ecM+euftLlK4MfdrnH8n9Vy2os+jW6RaJLDfS4A6GwavmE8WvkwLoQdhte59t8I XupCLOmQ6tdytDeVYMcPNZtXaQPTRoJvLnMBTLAc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Howells , Martin Schwidefsky , Heiko Carstens , linux-s390@vger.kernel.org, Al Viro , Sasha Levin Subject: [PATCH 5.3 117/166] hypfs: Fix error number left in struct pointer member Date: Sun, 6 Oct 2019 19:21:23 +0200 Message-Id: <20191006171223.153871377@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171212.850660298@linuxfoundation.org> References: <20191006171212.850660298@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Howells [ Upstream commit b54c64f7adeb241423cd46598f458b5486b0375e ] In hypfs_fill_super(), if hypfs_create_update_file() fails, sbi->update_file is left holding an error number. This is passed to hypfs_kill_super() which doesn't check for this. Fix this by not setting sbi->update_value until after we've checked for error. Fixes: 24bbb1faf3f0 ("[PATCH] s390_hypfs filesystem") Signed-off-by: David Howells cc: Martin Schwidefsky cc: Heiko Carstens cc: linux-s390@vger.kernel.org Signed-off-by: Al Viro Signed-off-by: Sasha Levin --- arch/s390/hypfs/inode.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c index ccad1398abd40..b5cfcad953c2e 100644 --- a/arch/s390/hypfs/inode.c +++ b/arch/s390/hypfs/inode.c @@ -269,7 +269,7 @@ static int hypfs_show_options(struct seq_file *s, struct dentry *root) static int hypfs_fill_super(struct super_block *sb, void *data, int silent) { struct inode *root_inode; - struct dentry *root_dentry; + struct dentry *root_dentry, *update_file; int rc = 0; struct hypfs_sb_info *sbi; @@ -300,9 +300,10 @@ static int hypfs_fill_super(struct super_block *sb, void *data, int silent) rc = hypfs_diag_create_files(root_dentry); if (rc) return rc; - sbi->update_file = hypfs_create_update_file(root_dentry); - if (IS_ERR(sbi->update_file)) - return PTR_ERR(sbi->update_file); + update_file = hypfs_create_update_file(root_dentry); + if (IS_ERR(update_file)) + return PTR_ERR(update_file); + sbi->update_file = update_file; hypfs_update_update(sb); pr_info("Hypervisor filesystem mounted\n"); return 0; -- 2.20.1