Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9253339pxu; Mon, 28 Dec 2020 10:31:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJwrwEf4fqbatKZ45kTew+IZcN5zT49M10Sh7i+pUxL6/haXEr/i5sfq6ttP7UA3LG0nRcV7 X-Received: by 2002:a17:907:c10:: with SMTP id ga16mr42528097ejc.43.1609180264248; Mon, 28 Dec 2020 10:31:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609180264; cv=none; d=google.com; s=arc-20160816; b=RIwAnqK3qS+C9tyePwTL39nyhj8JhPRzAWiNKsQt+gXTXu2qPse2/IPT+LlqpldIg7 oUURPHbwoNeLLNEQyuUjwkAH6mK/rDsnXEAKPs0sZO1eD85taz3sGWp572OAXQtjZN6F 74R1e7LpNDSOTyUM5VhZf0A8tL7m6JPmqWcE3t24fhyc8KqCQIOLkM+adFgPmVcpJM28 OZ6pv5uP1e1Xmb2CY97p944GzZ6wNeBzg7o76MBugAmj4Qk8a4MXpeJsfIvplMZaHLwq 1ZNhn9QJRWqoDTUftI+/mO9X4GewcvAKw9C+y5iF0vl8wEm/R1xY867LX1jxX57TkMI+ ir5A== 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=SXu59xpcF1JI/88lO/Msh7Brn7ZxT6+HYm+eT6cT79k=; b=QzlhzvfYnjtUX5yBKuLS+Sfgf7ifPsUKSacFwQ47WXs8tZS+BN1nwiRJW6c2QzrCwc x0EzFIcijOhv3SS2n8Qyv3eVEcwLx29mWMMVMBORiCyzj+2gqFJu40feq/efzqKiUeG5 RG1D6tOacwQ7xreAN9H9suR7t/LaLDUDF4T7t+lGIQxJVDu54hrakcn4BsIaGiXBYXxR 9IPbUjba1WtYY7um9MfLVmUx3/uKru1fjhQkUxPdgEiFQ5imgAn+h7vippViL1oAp7JI sv/6z86LO9TYih3s7Kk7/4epFtzGUz0LoWm9wJBVm6fzm2DNKx6E11W10UOegRF5LHKN Fxbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DR3JMjN3; 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 dp16si21955172ejc.635.2020.12.28.10.30.42; Mon, 28 Dec 2020 10:31:04 -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=DR3JMjN3; 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 S2389103AbgL1NeR (ORCPT + 99 others); Mon, 28 Dec 2020 08:34:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:33466 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387916AbgL1Nd3 (ORCPT ); Mon, 28 Dec 2020 08:33:29 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 29098207B2; Mon, 28 Dec 2020 13:33:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609162393; bh=6CkPs2ujHlxlPBa53kvmNhuZ0HpXp0KvMTgOcXzKtMg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DR3JMjN387QGe3k+pgdCPytP2UWKQbnhQe2fUF+SikqKobHdIf6hnI0K3fFWADFf7 5hW8NqOkVgeRe8tmimq+UDu92jCGgSPp5tvJDHqH/Q1NF2DPgedEtlnHmUb3dlA4zC baVcE98T6i3VnTaWuLwu3yh/oTRTxmo831BDylI4= 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.19 249/346] clk: s2mps11: Fix a resource leak in error handling paths in the probe function Date: Mon, 28 Dec 2020 13:49:28 +0100 Message-Id: <20201228124931.817751236@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124919.745526410@linuxfoundation.org> References: <20201228124919.745526410@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 4080d4e78e8e4..f3aaefafba893 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