Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp6020782ybn; Sun, 29 Sep 2019 10:36:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqzz6tV4IrcMzh+HFE0r+cUvz8xhbgd9zKiXALyHCuXQ26ynS6+eog6+ZbR80tABw3Zl3Zvo X-Received: by 2002:a50:87ca:: with SMTP id 10mr15681308edz.77.1569778563726; Sun, 29 Sep 2019 10:36:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569778563; cv=none; d=google.com; s=arc-20160816; b=NKS0EmUND3qGMFE109TiWB/+CffMDimnbFSBxELQKANaBqDx0Wg9jNfl9vjapLpzTf dLNSRQROEeDYPZ2+cWp8UEkmsTK6IGFGHZZupp/OVfQnR0TPBq5TrruJrbDp6O8M69ad +rlTZnJlSiBWn1o76QtkqD1lYxuqoRdnQETGPZac2pwdAWQ0U0q7mctPAEKYS+EbNcDL Q05NGTvdPE8q29tKRq0sgaltqn+WzmDB6AiVLBUnl7FJBEbAYGBCi3gY5EIz6v3aNDjd 7j4OumII+IOSgYdBK3MI3k9tQv7DAlGs3zbU/x0ofSqW68zBTkfreADsf/3HxCDPuZsY xX2g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Ap7AnRph2DlXKQ8izKydqAT0/gMAXFCi/6lItM1QRnk=; b=rKWUEtnkl3FHDqjtwPgjiUtHGB1NpKlAWjtONMObQC2JthGs31PoHN+Z/MraG71DWq cD65hFVteo6P+uVgXeKWZE7bXl5hHhWWQQkv4uag6UX0XF4l8kV4TH1Q1sbm169OqxwT ABHA6TuMyRgPppn7/BpfBCjXGN55q/AUQybK4u8IMsIp+cojFyyoxNqhPx9TT8Tar05g cwg9QNJw0Fl4ECNmNRwtFhJlN2ZFZhUNv7oac7YmG7G/lykbnYmir4a8HFPJzxGEKtpw N3TV1eyu/80nkKzPWxtJ1FbhDMyX10zSz6wynpvc8v0GJEc3oWF9l3y605wleL2LkNHk PRVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NamSCZ84; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a25si5856054eju.71.2019.09.29.10.35.39; Sun, 29 Sep 2019 10:36:03 -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=NamSCZ84; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729681AbfI2RfT (ORCPT + 99 others); Sun, 29 Sep 2019 13:35:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:47350 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729564AbfI2RfJ (ORCPT ); Sun, 29 Sep 2019 13:35:09 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 93DDC21906; Sun, 29 Sep 2019 17:35:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569778508; bh=NW/m6R8uPelyLkG1YSOb/QZBuuaoEuyf1FdlJras63U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NamSCZ84Hd9zsbXnde9LEbwlU8xxPBEKjKtQ3mw59VYk2F8A8dUeBR517gOReUKKL P9Ss2W5HYJSm40izXJBdXdAptbt22/2Wk3UdRwSfnCuh+AA/Ia5IWCe/BeMSWG3Ik2 /pEuRNfpZZ9CVbjDztjsEicIm/He5D8qpTVb4CdE= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: David Howells , Martin Schwidefsky , Heiko Carstens , linux-s390@vger.kernel.org, Al Viro , Sasha Levin Subject: [PATCH AUTOSEL 4.19 25/33] hypfs: Fix error number left in struct pointer member Date: Sun, 29 Sep 2019 13:34:13 -0400 Message-Id: <20190929173424.9361-25-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190929173424.9361-1-sashal@kernel.org> References: <20190929173424.9361-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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 c681329fdeec6..e4d17d9ea93d8 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