From patchwork Sat Jan 12 00:00:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Kent X-Patchwork-Id: 10760807 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E82B191E for ; Sat, 12 Jan 2019 00:09:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D61CB29DE3 for ; Sat, 12 Jan 2019 00:09:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CAB3129E05; Sat, 12 Jan 2019 00:09:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 827E929DE3 for ; Sat, 12 Jan 2019 00:09:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726484AbfALAJw (ORCPT ); Fri, 11 Jan 2019 19:09:52 -0500 Received: from icp-osb-irony-out3.external.iinet.net.au ([203.59.1.153]:46786 "EHLO icp-osb-irony-out3.external.iinet.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726193AbfALAJv (ORCPT ); Fri, 11 Jan 2019 19:09:51 -0500 X-Greylist: delayed 555 seconds by postgrey-1.27 at vger.kernel.org; Fri, 11 Jan 2019 19:09:45 EST X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2ANAADXLDlc//yp0HYNVhsBAQEBAwEBAQcDAQEBgVMEAQEBCwGEEoQBlFkBB4R7hWmJRIUHgXuEdAMCAoJLNgcNAQMBAQEBAQEChmACAQMjBFIQGAEMAiYCAkcQBhOFF64AcXwzGoobgQuBc4lYeIEHgRGEUwGDCINAglcCkEA2kQUJkhsLAoofA4dOLYJnmRwGggFNLgqDJ4InDAuOK2WICoJNAQE X-IPAS-Result: A2ANAADXLDlc//yp0HYNVhsBAQEBAwEBAQcDAQEBgVMEAQEBCwGEEoQBlFkBB4R7hWmJRIUHgXuEdAMCAoJLNgcNAQMBAQEBAQEChmACAQMjBFIQGAEMAiYCAkcQBhOFF64AcXwzGoobgQuBc4lYeIEHgRGEUwGDCINAglcCkEA2kQUJkhsLAoofA4dOLYJnmRwGggFNLgqDJ4InDAuOK2WICoJNAQE X-IronPort-AV: E=Sophos;i="5.56,467,1539619200"; d="scan'208";a="155670383" Received: from unknown (HELO [192.168.1.228]) ([118.208.169.252]) by icp-osb-irony-out3.iinet.net.au with ESMTP; 12 Jan 2019 08:00:34 +0800 Subject: [PATCH 2/3] autofs - fix error return in autofs_fill_super() From: Ian Kent To: Andrew Morton Cc: autofs mailing list , linux-fsdevel , Kernel Mailing List , Pan Bian Date: Sat, 12 Jan 2019 08:00:33 +0800 Message-ID: <154725123240.11260.796773942606871359.stgit@pluto-themaw-net> In-Reply-To: <154725122396.11260.16053424107144453867.stgit@pluto-themaw-net> References: <154725122396.11260.16053424107144453867.stgit@pluto-themaw-net> User-Agent: StGit/unknown-version MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In autofs_fill_super() on error of get inode/make root dentry the return should be ENOMEM as this is the only failure case of the called functions. Signed-off-by: Ian Kent --- fs/autofs/inode.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/autofs/inode.c b/fs/autofs/inode.c index 0e8ea2d9a2bb..078992eee299 100644 --- a/fs/autofs/inode.c +++ b/fs/autofs/inode.c @@ -266,8 +266,10 @@ int autofs_fill_super(struct super_block *s, void *data, int silent) } root_inode = autofs_get_inode(s, S_IFDIR | 0755); root = d_make_root(root_inode); - if (!root) + if (!root) { + ret = -ENOMEM; goto fail_ino; + } pipe = NULL; root->d_fsdata = ino;