From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A044C10F14 for ; Sun, 6 Oct 2019 17:31:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6EFC12133F for ; Sun, 6 Oct 2019 17:31:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570383063; bh=NW/m6R8uPelyLkG1YSOb/QZBuuaoEuyf1FdlJras63U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=R/ZUSwXEG3J0lZHTDHbPBNx4n/NbnkeOxf5fVY2s9hUUvM/zT1ynM+BRctzi6Xq0M C1vuhCEQFRK+otKkk0A+tzJftOOjXzNyQzNMmY57ZnGOA3QlB1/6VO/zf1vuZ0GLk8 NnT/EmvQHnSxlO7UVahxO/8bi2wUTandysHKfumU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729342AbfJFRbC (ORCPT ); Sun, 6 Oct 2019 13:31:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:57018 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727403AbfJFRa6 (ORCPT ); Sun, 6 Oct 2019 13:30:58 -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 6FBCA2133F; Sun, 6 Oct 2019 17:30:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570383056; bh=NW/m6R8uPelyLkG1YSOb/QZBuuaoEuyf1FdlJras63U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WCYORMYd4Oo5bB3xwq8dn2vinnRUzJ4i6zYfT2Hf0RvExe2doWQboimw/Sc36vuwZ mfCXIF0wvwDOiuJxN0e6B1bikoffxWvgpo8JgIdQgorbsdtYfVxWSS1I0CbpxRtwcR Tti+4GX9kqaiT5E/IL1Qi1VWSsYK/TVf1Tr8M4OU= 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 4.19 069/106] hypfs: Fix error number left in struct pointer member Date: Sun, 6 Oct 2019 19:21:15 +0200 Message-Id: <20191006171152.503987621@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171124.641144086@linuxfoundation.org> References: <20191006171124.641144086@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 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