Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp565289pxj; Thu, 20 May 2021 16:22:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2ZzdaFday13yXKR14zwIc53B/yXlH1t1NA1utp2mgoNyJQnrYSxb4Wyi87sE6s2tUcIUa X-Received: by 2002:aa7:d890:: with SMTP id u16mr7561167edq.49.1621552932476; Thu, 20 May 2021 16:22:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621552932; cv=none; d=google.com; s=arc-20160816; b=uTstRuAjxNFiyfmbEK0IRjTF0a4SJ2SGmj0fyii2XN41kK7yY3xRw897fZr2LSoxOR 3TMf9hp/+BV5ls5Yw/ftsvujKt3tLjPNRMj1W6JFgLf1NNM48AV6HogVHHA9b0XMIWok dbIyh4aVD7zjrzibnZcf0IG79h0LqLpLFXaqDY/O0UF255C71DJF9mF7IREe9nV+TEIJ 9Yg2x3Su8+H67FAdVc21jMdDyTWsBf4rS9CMYsjTr8YRDoJvR7jIqySWPrnXyWTH8nWR SUpKBKLV1xPHTx4dYkzqa9ur7EMZTYSQv6HVcXlYCWkl544sRsbaQeKz7gMPj7T3K4bH o0Yg== 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=5GbzvQoacSckPnWDIoTGh7mLAZJ/Ey7gYgI5143ysfM=; b=gCDufw3rsFyhRGObKktIZZ1MWrDTIGFFM1frXx8e/zxoWikOwwz0zf4Ad5X7XCqw91 KOeB3EZ9O7xacYXTuQK9fnUkbSqfOcVRMMOX7/X6N4h9t6fdPAYsSEiRApf5nJ4twopu jO/EyZxQRLHwJwzuf2DNYcRcxle1KkLjiyFj7a4Qx5eWDrxeTd0M6Xhkiu1PQrmEtG9X RhTnihPHZtSwigie7SJDcWYbSsaTex1gjPVeGS3cOuWgZdZD72RIZc483PMgmPa+AzDl O1NErB/KbAaQTimsZ4774mTbFSxfVS1I0lcJugl32Sqiq5x03gZtl/N1NBkIoUn9jZiI 0gIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=y3Jh5MS3; 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 19si3604015ejx.529.2021.05.20.16.21.48; Thu, 20 May 2021 16:22:12 -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=y3Jh5MS3; 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 S240724AbhETL34 (ORCPT + 99 others); Thu, 20 May 2021 07:29:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:55582 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240309AbhETLJn (ORCPT ); Thu, 20 May 2021 07:09:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2514B61939; Thu, 20 May 2021 10:06:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621505205; bh=zkpyHWDMow+yanN2rf0LhKYSxQoSglRoOdF3EPPw7a0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y3Jh5MS3oPuwRsyTkPNmIYP1umLm/03i5ZG8AWkTt+whNBJsgKV0FhO0Z1fjjhbCM t7JmdUBbiJn2m90WiAtX1uyJ/3VX4P+ok/3Qr62mGzC5eB8uoq9P0qR4x2PRKOGSXs Lq01HzHkH7vl4v+FwzAeFNVmL9aXQDlGTrh/TXVo= 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 4.4 029/190] clk: socfpga: arria10: Fix memory leak of socfpga_clk on error return Date: Thu, 20 May 2021 11:21:33 +0200 Message-Id: <20210520092103.135142308@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092102.149300807@linuxfoundation.org> References: <20210520092102.149300807@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 1cebf253e8fd..48e371035a63 100644 --- a/drivers/clk/socfpga/clk-gate-a10.c +++ b/drivers/clk/socfpga/clk-gate-a10.c @@ -158,6 +158,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