From patchwork Sun Jul 8 21:01:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10513363 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D9E0E6032C for ; Sun, 8 Jul 2018 21:08:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCD16289DC for ; Sun, 8 Jul 2018 21:08:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C09B6289E0; Sun, 8 Jul 2018 21:08:41 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable 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 7B14F289DC for ; Sun, 8 Jul 2018 21:08:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933275AbeGHVFi (ORCPT ); Sun, 8 Jul 2018 17:05:38 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:46515 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933241AbeGHVFg (ORCPT ); Sun, 8 Jul 2018 17:05:36 -0400 Received: by mail-pg1-f196.google.com with SMTP id p23-v6so694705pgv.13; Sun, 08 Jul 2018 14:05:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YStFHdlOjG+PYR2LhESu+DHYn4LbE5MdZTCdHrP+WaE=; b=QkgNPYI8IeYriOzamc9o/ptPVcK4tABQO97AXQTCglLOBBFUOh6C5CtN2Uu+QowYjy ntxl872eIsU+nbwaOLfb2/4bmp/kofPFqsRFJPlMR4ewDExbJzQ6/xzisLVJLHJkeBfQ oF1NZD/ed8jP0sSHZ1mtnM3ORAADFXhXFT3iMdiMD6y8YOtCrKZLjuPFMh8VHfe4dG4q MzUxqWLE5GqtTtF+KrHV+4Iz+6VCqm6FPu2OT6/Np/Ft+ljeDhk7WGcyFXPSoWRsDLlv tqJJ7OVaQ5edmk8Xqyh3HUY2BRy9cA2eaQCN/mF9QYs8Ztnb9X2DVMeIKyCMHYVU8Uvm jDCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YStFHdlOjG+PYR2LhESu+DHYn4LbE5MdZTCdHrP+WaE=; b=T6bbHfl6pDRj6dizePhCR/6bR9/iuive3DzY8HxJRsZDE5GWhcef4V6SxKlBrrdbN6 oLWj20Dlcw4PgW9e1vPTLvUxkUkPI7MFHHC80tsArrxbp9s7EwzKVU8w+XrO9aXTW0Hv q99vOMCA94YoMiE9S1+nN9I7LRu8d9qE6ZDRlPL0LZcBmMNsidWzRtQbdH9Bkmv0lW/8 sqCvTx7vl8xKcnC+28n/IlcnV4X61PCG+eyfLMNHMaLbiAIZhpJD8Nn4J8TROGnjw5Qu D9jZqcHFUa9juWs4Z9W6DTnbSfEgd0miRdx4zc+3hNUA+xRozQIZyRZ+p+XO7ERMhP3j tOoA== X-Gm-Message-State: APt69E1No2LsrCuhmVFqE//SHIVYTGEIuemyTM0RxY8dcz/oNi5g8laq CQCQ+BdZdcqNQlc7Ba/MvWu2tli7 X-Google-Smtp-Source: AAOMgpemsEUVmMloaTxv/2Z45l9JKuJZNSiV+m1Rz/6GyqnAOKwdTMpQ3Nk6suaj8I7LtFoJm9BISw== X-Received: by 2002:a63:b256:: with SMTP id t22-v6mr17029125pgo.101.1531083936179; Sun, 08 Jul 2018 14:05:36 -0700 (PDT) Received: from sol.localdomain (c-67-185-97-198.hsd1.wa.comcast.net. [67.185.97.198]) by smtp.gmail.com with ESMTPSA id x68-v6sm23355681pfb.138.2018.07.08.14.05.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Jul 2018 14:05:35 -0700 (PDT) From: Eric Biggers To: David Howells , Alexander Viro , linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Eric Biggers Subject: [PATCH 04/18] fs_context: fix fs_context leak in simple_pin_fs() Date: Sun, 8 Jul 2018 14:01:40 -0700 Message-Id: <20180708210154.10423-5-ebiggers3@gmail.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180708210154.10423-1-ebiggers3@gmail.com> References: <20180708210154.10423-1-ebiggers3@gmail.com> 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 From: Eric Biggers Fixes: 8a2e54b8af88 ("vfs: Implement a filesystem superblock creation/configuration context") Signed-off-by: Eric Biggers --- fs/libfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/libfs.c b/fs/libfs.c index 823f0510e43da..d9a5d883dc3f5 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -588,8 +588,10 @@ int simple_pin_fs(struct file_system_type *type, struct vfsmount **mount, int *c return PTR_ERR(fc); ret = vfs_get_tree(fc); - if (ret < 0) + if (ret < 0) { + put_fs_context(fc); return ret; + } mnt = vfs_create_mount(fc, 0); put_fs_context(fc);