Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp823552pxb; Tue, 3 Nov 2020 13:34:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTW2zuZ0kgsNoC/XMb92dioi4DVSDfswURq/w+Vb7pj7djCjOnsg7AQp0L8WA9dOy3sVMS X-Received: by 2002:a50:9e69:: with SMTP id z96mr19105519ede.226.1604439248136; Tue, 03 Nov 2020 13:34:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604439248; cv=none; d=google.com; s=arc-20160816; b=rV0DKcD1rznNn1Y+eo8vfwjkem8OkVD4wpwRQubvfGqQxQD7+K+JdNXMBK9+nJh0PE XdmaxS7NI2fZP8sQfDeZZC0QFBjG+WSf/+uZDSv/29BnSTghSZbopfoI0fyCfU6JGMz2 9+uGtrl8CqdhSAaKUkCUXEDtghUVhpl7tlnvZmj6ieel+Ipaz8BpzRTKXiGe3A+zGKto yi3j0OfiukKQfzVulTX7jCytPdoo9Ye/PL2XPupv2g5tDy4grEy+WpQT/ax5TQQLwcY1 D8m2lPsuAPeGUj32RqMfVyeflFj4DZUSBbreuyauN17HHPU1hRI70aWsWAirFk64XzvY 44FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JmI1qplkD5RJ0JGsfIYA2Czo3zQIWZSppyJ50iu8BN0=; b=C2ZW0ffE3Y9PGORHnghDKFwVj6yJO0dQuDn6c4mdmSCq/IGe4hDNQ5YtAbWt1dM9CS 2gI28CVuhXuBWmXjfeX2F0PhkI5x7MyOtG1l5OecyvjsDCysABsHJ5y7bgfJvwKwjaw+ y+VOO62J9MqcQcSfMv2/Q2SpWOZNz8aOlAbEV0ujzrUi2YtkBDOkF7qJlbNCh66sn8zq x8X63i1ywyNdUrcGmO7/OJFN23eWn7mc8RKo2kPFLDav+3hr/7RD5XlS3i5b/VlpEkFN hWahc/tgXazaDyK7cmFRN1LdaYKTS+lVKfXJXF5sEzAbUy3/iYxbHa/RENknfMFrWewO 2hbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=D9G8ul4Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p19si13557837edu.169.2020.11.03.13.33.44; Tue, 03 Nov 2020 13:34:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=D9G8ul4Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733082AbgKCV3W (ORCPT + 99 others); Tue, 3 Nov 2020 16:29:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:34368 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733096AbgKCU7T (ORCPT ); Tue, 3 Nov 2020 15:59:19 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 118352053B; Tue, 3 Nov 2020 20:59:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437158; bh=XbiyG2+4XCbltU0Pwl003nOHv4xzDOODOFq4L/u/11g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D9G8ul4QVDKf0FouHksQ88Mh4O+wGU9/B7teNg/mgmM/uRHWnnIWZIG+6PVjgti6J qMtgT8xSfesxhuDze2SKQVB8367eITmPLzRm0zmgmpIanKI+wGwEqb5SMei07gjsH6 YFR2Mxs/5NEj4SaXw9xt/HGEwvxP9GUMMmQd4f8w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhihao Cheng , Sascha Hauer , Richard Weinberger Subject: [PATCH 5.4 172/214] ubifs: mount_ubifs: Release authentication resource in error handling path Date: Tue, 3 Nov 2020 21:37:00 +0100 Message-Id: <20201103203306.858426937@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203249.448706377@linuxfoundation.org> References: <20201103203249.448706377@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhihao Cheng commit e2a05cc7f8229e150243cdae40f2af9021d67a4a upstream. Release the authentication related resource in some error handling branches in mount_ubifs(). Signed-off-by: Zhihao Cheng Cc: # 4.20+ Fixes: d8a22773a12c6d7 ("ubifs: Enable authentication support") Reviewed-by: Sascha Hauer Signed-off-by: Richard Weinberger Signed-off-by: Greg Kroah-Hartman --- fs/ubifs/super.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -1313,7 +1313,7 @@ static int mount_ubifs(struct ubifs_info err = ubifs_read_superblock(c); if (err) - goto out_free; + goto out_auth; c->probing = 0; @@ -1325,18 +1325,18 @@ static int mount_ubifs(struct ubifs_info ubifs_err(c, "'compressor \"%s\" is not compiled in", ubifs_compr_name(c, c->default_compr)); err = -ENOTSUPP; - goto out_free; + goto out_auth; } err = init_constants_sb(c); if (err) - goto out_free; + goto out_auth; sz = ALIGN(c->max_idx_node_sz, c->min_io_size) * 2; c->cbuf = kmalloc(sz, GFP_NOFS); if (!c->cbuf) { err = -ENOMEM; - goto out_free; + goto out_auth; } err = alloc_wbufs(c); @@ -1611,6 +1611,8 @@ out_wbufs: free_wbufs(c); out_cbuf: kfree(c->cbuf); +out_auth: + ubifs_exit_authentication(c); out_free: kfree(c->write_reserve_buf); kfree(c->bu.buf);