Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9179834pxu; Mon, 28 Dec 2020 08:33:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJznzy2wlD5PvpbyY2fG55aNWmArnMx9nZETGu3j0yhrZkQBZZbDm7fu/257v/TiSTL5c6uH X-Received: by 2002:a05:6402:2066:: with SMTP id bd6mr42722333edb.211.1609173227998; Mon, 28 Dec 2020 08:33:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609173227; cv=none; d=google.com; s=arc-20160816; b=MhxWjddevyiC2D1CGtwXvrzNe4sMQsY+JvNw1wjBhgXEpnFL5UEM7iwLAdPDdktIN9 7sw1yV/80q0TYtpZrRmYFA93zmfbg/LjulLwBdsy/lRFwn8QqJzocQy7uc1z02Ssq+tf WpaA0EsFBCARcKDvAsQ54U6Gs7/MAQi+G2SUJLH0SrKD42pmbO/EaLKwMvLRczldjreL pkV3b0WId/e7p19g5RvFV13TZeXYynS7NnaeXZOgNpq2kAKkmRTIJwXvSDn0ciqgSCtm DLry6IORvHVouPz3hnDrS2kUS9+EfKg0jwMR6GSq83SqywekEc0f8CbzQDn6uQ/yE6Lj 0TWg== 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=suHbAJK6COCS+knsrutQ5aRkQ/gTWRmCuvpkDR8vdRk=; b=sHUhhEbwZe2xgYt/5ynjKFNRffL0ORD015kJjWs9OLU5xB0+cpiXhtazZ+zFtwPo3k VMDUEG8ymWxtLrfluzbRVfEzcw7ESvT+1jf6PS66mD2cwZo4zy+DrLoRnLFa1DRaAcPz I7+KnXGSembcnmpy5OCwTqmmVBTI/Eh/GLueoAtxm+rhDnwoNbRhfXX6WizacLoIjb+p KjRR8pD1Rmyk7sfaM6ERZpNJSEDso6TgbUgqD/ZR21xZIMZa603SYrOhSJwpbech69FI 3VrVPeMX+dR1JuMniMJPE2RpSJ7s15p2NCiOZjijEj9jbHcLrb2N1HrcwT+eUPjHuSzV IMGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Nofjy6Al; 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=pass (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 n8si20209084edy.54.2020.12.28.08.33.25; Mon, 28 Dec 2020 08:33:47 -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=@linuxfoundation.org header.s=korg header.b=Nofjy6Al; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729662AbgL1NGf (ORCPT + 99 others); Mon, 28 Dec 2020 08:06:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:32854 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730687AbgL1NGD (ORCPT ); Mon, 28 Dec 2020 08:06:03 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id DC2C122582; Mon, 28 Dec 2020 13:05:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609160748; bh=6H5pjMjHihSttCdD9uwYDZanw03bglRNU90wlsoq1jY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nofjy6AlF0TyYESRIPTyB7+nne0Smy2r0MRt79qyH1g9l6HZnF7vs3HEFViGdlQHs rTKisTlzm3YCv15JZcgbr1T+gPZHUrxVLaUBUlBkxhQpBfCQ/sjP+gHmHe3Fs4Brn0 8tjK9sNdBpAM7BLUCFTR3hUXricJM/vTIwhcanjY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Krzysztof Kozlowski , Stephen Boyd , Sasha Levin Subject: [PATCH 4.9 127/175] clk: s2mps11: Fix a resource leak in error handling paths in the probe function Date: Mon, 28 Dec 2020 13:49:40 +0100 Message-Id: <20201228124859.407962502@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124853.216621466@linuxfoundation.org> References: <20201228124853.216621466@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: Christophe JAILLET [ Upstream commit d2d94fc567624f96187e8b52083795620f93e69f ] Some resource should be released in the error handling path of the probe function, as already done in the remove function. The remove function was fixed in commit bf416bd45738 ("clk: s2mps11: Add missing of_node_put and of_clk_del_provider") Fixes: 7cc560dea415 ("clk: s2mps11: Add support for s2mps11") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/20201212122818.86195-1-christophe.jaillet@wanadoo.fr Reviewed-by: Krzysztof Kozlowski Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/clk-s2mps11.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c index f5d74e8db4327..1803af6230b27 100644 --- a/drivers/clk/clk-s2mps11.c +++ b/drivers/clk/clk-s2mps11.c @@ -211,6 +211,7 @@ static int s2mps11_clk_probe(struct platform_device *pdev) return ret; err_reg: + of_node_put(s2mps11_clks[0].clk_np); while (--i >= 0) clkdev_drop(s2mps11_clks[i].lookup); -- 2.27.0