Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5998557ybc; Wed, 27 Nov 2019 13:09:05 -0800 (PST) X-Google-Smtp-Source: APXvYqytbAVxn9zrAMIPRcwfRFVI0KXLd1oHfk6yEPU9o8KnYe4JvFnDClLt8TptUQhTfifudkxc X-Received: by 2002:aa7:d904:: with SMTP id a4mr29855503edr.44.1574888945530; Wed, 27 Nov 2019 13:09:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574888945; cv=none; d=google.com; s=arc-20160816; b=PilmhtIO+xalEUhXqE+Me3c6j19kXXPLaUI7B++XdSewdfmSd6xwS8291fP4y2GZ3i 2vz0XRCGOnd5XL1XW/5kSiZZCgGZgsTiY+KagCn9U7YRdLnbcPS6Y89aaTHn19rbi89i dvli9EFOaK9iwAbaY5Mw14A16hmWiuLDnJtxcQHFvvB6U99NEXQmks+O5gwRdlQupyqq 09AxYjR6g/2IJz5rEHnPKu271YrxgxkBZax0To97erQhZDGsKvi1qGxJ8JOFIlE9Stax vN5iFN2iY9RnLS3CftVVvKyL5AUbAEuLt+6HV1U6/c1VphEIRwFB27HfTIYW+rShiMeG au/A== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3L2uo7XqjMqqstdpGnygmE/vrV95hGnvTXYhdGdD5LI=; b=W16D/3g8VoRFN+jYCQfMAgwxV57S8vdsI9hx+Zb62u1a/UvhoZzdzjz18w79Oyo0My 4c4uMK4kc2M7T6AYDqNAdHqSTqkrI+XQkifagP+Kpbo/3ANvKUJvBObn3QuIwSMYFqQk 9/fxU5rAZxSqKDa0ZhffmjA3s3/Njyqed2gm98inhcb5pDgw1ulP4wHK2YUROnmJ5EM5 /DlHwnqrhPqUUvDPqfTWPAoxPd5576edbEJ6cWTQGfuzrmlIX9J2l+QMA9+olaHIsYHY +XNwFYnIwC8c+blsJYaaGSQTyzB4X/97CEwGn1kso6J4gypimdW6DzpI2ftkzztlh9+c rvwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bnMKtRhn; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cw24si893984edb.382.2019.11.27.13.08.39; Wed, 27 Nov 2019 13:09:05 -0800 (PST) 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=bnMKtRhn; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732561AbfK0VHJ (ORCPT + 99 others); Wed, 27 Nov 2019 16:07:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:33204 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732552AbfK0VHH (ORCPT ); Wed, 27 Nov 2019 16:07:07 -0500 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 0D5912176D; Wed, 27 Nov 2019 21:07:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888827; bh=H0+p4fK298kw1jSTheIrFbd+g0vAAzU0oZwSoqofGG0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bnMKtRhnOSVp8qgFtTiaI7+DlYCwsGkKp2vRrWxNxE5EMxt/zJELqESDtnQwylLW4 DK1xvL5IdO/inHHQUdWn5DSvaaXDb5IFYjTxti5n/pdSzpi7qt7DLYVAZPhun74Fiz tQNIGengpRbfoWZ2JaXovhzmLPBthWqPJOfavg3c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tycho Andersen , David Teigland , Sasha Levin Subject: [PATCH 4.19 233/306] dlm: fix invalid free Date: Wed, 27 Nov 2019 21:31:23 +0100 Message-Id: <20191127203132.024274952@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@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: Tycho Andersen [ Upstream commit d968b4e240cfe39d39d80483bac8bca8716fd93c ] dlm_config_nodes() does not allocate nodes on failure, so we should not free() nodes when it fails. Signed-off-by: Tycho Andersen Signed-off-by: David Teigland Signed-off-by: Sasha Levin --- fs/dlm/member.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/dlm/member.c b/fs/dlm/member.c index 3fda3832cf6a6..cad6d85911a80 100644 --- a/fs/dlm/member.c +++ b/fs/dlm/member.c @@ -680,7 +680,7 @@ int dlm_ls_start(struct dlm_ls *ls) error = dlm_config_nodes(ls->ls_name, &nodes, &count); if (error < 0) - goto fail; + goto fail_rv; spin_lock(&ls->ls_recover_lock); @@ -712,8 +712,9 @@ int dlm_ls_start(struct dlm_ls *ls) return 0; fail: - kfree(rv); kfree(nodes); + fail_rv: + kfree(rv); return error; } -- 2.20.1