Received: by 2002:a05:6520:4211:b029:f4:110d:56bc with SMTP id o17csp2110715lkv; Thu, 20 May 2021 03:39:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2Bze0ctoly35m3dtQzOxhY9dkDb3aC9Uu2CbEe2RufW1fHzYU34feTaw+9/K7LvjBCDPS X-Received: by 2002:a05:6402:128d:: with SMTP id w13mr4191828edv.253.1621507199429; Thu, 20 May 2021 03:39:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621507199; cv=none; d=google.com; s=arc-20160816; b=oEhJ5w2cJ4s3kFw3gPHRhDlO44vwAfHz1/Ys/ANSDqggPKZLKAKhG1XOAorErt1pmE JhOBHYnf4vjmQJ0DlQMjv0nJscLf57YglrbWYxDtExQKTBd33uVx0MBEZRuPZWQmWPu6 lxnADZ1BThw3XWaTu7j7Y9y0IVqV5FAuWINhhwofmAFuRyovTcx+mEpgehe72kntnIjW EQIvykGm6mPyvvx3m3LJG6pGhOIx9qQ+VOGiPN9HsvqGTjmVi93PPP7wigKK2XS965nH Ttbg9+CTWY5QT6bVgX/c/9+gjwOccmZbshRML1zNB+0CFlWhGRjSdrC9DGhO8z8wOnU3 k0uA== 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=fWYkdzdZlhef3LpvaDlyKNI7ToBFXr9iUn5A26Ys1tE=; b=owZYw2PocQBzaG/I7S/Zf4BG308Sq/7hqNxBF82TX7p34vzusZcpOCitMSR+9EZQ/w i5hlyyxRbICWLvWx7PURtPHPt2PKcDqkCJq2bEp8Ekpssdn6gza2EiQlcCBtNJyMdBua QODzRY640IP5DtKW278/Mv7LST1t/BL219R09LrvaSIDLR+DckEkkBZNajVbeBPYX2H6 r93rdm46FvEWdKSacZwbCDau0IUV7DUcoHmDcNQ685Cy8zUv+TjIYffaChHeTlZ5964U wptbkYYw64wf7foV5qtsYw2NPUzpaq8aFsdqp4+Enr+/XvvL4Y6+x3fyE4yHtF3/tx96 XliQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WARzeifr; 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 nb19si2475394ejc.581.2021.05.20.03.39.20; Thu, 20 May 2021 03:39:59 -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=WARzeifr; 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 S237943AbhETKgI (ORCPT + 99 others); Thu, 20 May 2021 06:36:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:51828 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235063AbhETKWf (ORCPT ); Thu, 20 May 2021 06:22:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C1BDB619F1; Thu, 20 May 2021 09:48:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504105; bh=ORvfsTPWidhMijguO6X2vUt3yYaF9/7ZZj8+OK9Lx3k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WARzeifrhA7VZfKPFx58cl+JhVXlg5f+ZTeVcCdgvIThumtb0qDeLQYuaT3CwD/mC NXbe2hbdH7LASTVqfC+eoiR6J+Jmg4qksrchfLzt0dR3K6ITTjQXXipLOprKom3Yrk B+x1LwmFv+duL4K1g6QrDQzNjT0+pELg46EckV9s= 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.14 060/323] clk: socfpga: arria10: Fix memory leak of socfpga_clk on error return Date: Thu, 20 May 2021 11:19:12 +0200 Message-Id: <20210520092122.174952678@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092120.115153432@linuxfoundation.org> References: <20210520092120.115153432@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 36376c542055..637e26babf89 100644 --- a/drivers/clk/socfpga/clk-gate-a10.c +++ b/drivers/clk/socfpga/clk-gate-a10.c @@ -157,6 +157,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