Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2483151pxj; Mon, 10 May 2021 04:11:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPvNy3WiHyOrXixEbvmBJVPH0RHEmD4Z6TuXJ9Y7TPcTw2wLA62nr5s3nkGJw7et5lm0s+ X-Received: by 2002:a92:6b05:: with SMTP id g5mr21005684ilc.40.1620645064458; Mon, 10 May 2021 04:11:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620645064; cv=none; d=google.com; s=arc-20160816; b=nMnug9QGT9HBgkxMQK9zUIJ99MsN2+UgGQyIG+9QrF8dTEG0lXCKylwWmLk5P9z1VH pymSwz/R8C8rpT21Tp3nkyc3q1xShX+hP3mmntDLJKpPNzHzHHh6qHPePY1SDM+cM5+T zflxdUUwNOIv1aAXI537C+j7TqNl/MVu9xe6ZQanGSqu45QzTDdp+W6ZM7+oY4socy2T yAaFSrHVXHDMYZNecgg+YOyU8BtzbyJYdUE7ukdXJ173/iC17SV+jtvongujceWUXl6R H/TEvEsmFQgY9kRTAAkqeTlSEW9mrqyV0v1WNbn5cr3oAbnHZy/2IxVSJy1/lZXL+rbX NRVA== 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=CVK1rztA5RlBkqEZk/mY3snHE/csVXqbxHTW6Iwk1lM=; b=BYHyMDLFfzXU5Om8HFlH5M1brWD7MYgX8TYFOZisUYpV6ryuE20fe3EJHvQizuC4L7 Ruubcd5UG7mub0oc0CeW+YcocWYOYeusee9etzl0WQItixVMjLgLVL2v1HYHHl+BBgho KBm79eeM4OI4Wz1oJlI/VB4Nh3MM22J2umramy+KOae3zTT+hSpF1EuxolypG3UwJphJ wk+nzVApi/qe9fVOH55RMtPxTW2AU03TbNQ4wndv+hblWgsOBwaahd2f+GU82Gw7K9C+ 7l0dpyhjlTZ5eWv0gNGW1p1ekpXLDV7nPmHaRlwvfKqj7fymL4NJTLLqQEp2HMCKtwz3 L8qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nd4tA6Gk; 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 j28si14699151jaq.115.2021.05.10.04.10.51; Mon, 10 May 2021 04:11:04 -0700 (PDT) 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=nd4tA6Gk; 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 S232356AbhEJLIt (ORCPT + 99 others); Mon, 10 May 2021 07:08:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:59296 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232815AbhEJKtN (ORCPT ); Mon, 10 May 2021 06:49:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 53F3F619CB; Mon, 10 May 2021 10:38:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643086; bh=VYfmhFt2W1DZcgIXrOOh7ooiC4aHcLCuxvOApxAU6hY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nd4tA6Gk8FwoxyBKbc2N5OKDNg5wD9O0K6aSsphE0edAUIY3xSkW2Y0D9VCsSvBd5 BZIg19CsKAFjRt/2FE+Gj+hHAEKNpJmiAXQ/dJNHBZs+HiWdz/I5uev+mSXK210EIk wi4W/0TLPAWe+dKtUlfZfm81FaIw+N8HcTF+2t2s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Dinh Nguyen , Krzysztof Kozlowski , Stephen Boyd , Sasha Levin Subject: [PATCH 5.10 173/299] clk: socfpga: arria10: Fix memory leak of socfpga_clk on error return Date: Mon, 10 May 2021 12:19:30 +0200 Message-Id: <20210510102010.675118075@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@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: Colin Ian King [ Upstream commit 657d4d1934f75a2d978c3cf2086495eaa542e7a9 ] There is an error return path that is not kfree'ing socfpga_clk leading to a memory leak. Fix this by adding in the missing kfree call. Addresses-Coverity: ("Resource leak") Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20210406170115.430990-1-colin.king@canonical.com Acked-by: Dinh Nguyen Reviewed-by: Krzysztof Kozlowski Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/socfpga/clk-gate-a10.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/socfpga/clk-gate-a10.c b/drivers/clk/socfpga/clk-gate-a10.c index cd5df9103614..d62778884208 100644 --- a/drivers/clk/socfpga/clk-gate-a10.c +++ b/drivers/clk/socfpga/clk-gate-a10.c @@ -146,6 +146,7 @@ static void __init __socfpga_gate_init(struct device_node *node, if (IS_ERR(socfpga_clk->sys_mgr_base_addr)) { pr_err("%s: failed to find altr,sys-mgr regmap!\n", __func__); + kfree(socfpga_clk); return; } } -- 2.30.2