Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp145016ybg; Mon, 27 Jul 2020 18:26:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZiWsf9MEC6sUH7onqo66miNLHHMQNgq2lZ9AnYdFqbfflyTn50kFFKNBlNe3TSAUo1sQO X-Received: by 2002:aa7:c788:: with SMTP id n8mr3970364eds.146.1595899561199; Mon, 27 Jul 2020 18:26:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595899561; cv=none; d=google.com; s=arc-20160816; b=cf5Si8Aqxim+KmBxjGurmszTFLQpnRWgaOKiJ9rnBWfvrKVTWIFR36+cNnDXivYwHq E+r8IiQi5OH9U+CCN8VwIiDJHdWJ8YcXcTHCHGvDw6GyEjXo/cPzS0PDISVCruZaPTZc UInc+mbHWHkNJM8Ew/YH2VAXxz8Yl0WlxQCpGEJpoPVCG9+M/KkXZYM6vg7hiHvki24V AVwB5afRbWjJwYkUO3EoOeU8pCEWrnvM+oSXTt+U2e0N2Yu1+EwvFQrbx2sqskmjB2MJ OOcJlb8CsxHi9Ctm9zFORaleiGsipkbOqpVLMyq/88HlHyVrUwSbry1tvq4n3WbjL0bt RIYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:date:to:cc:from :subject:references:in-reply-to:content-transfer-encoding :mime-version:dkim-signature; bh=TMWFEthAPcOew5ZEZ3dFGZOmTx9WTLZtb53DsnQZuJU=; b=LNVdCrwYHZhfjmsfb3eP2i7ic+oCbe1DGuqGEKPJoSS6RUVlVBdYiZuSWBoD2+lDZ4 0oL2igeoiISzubbE6uMl5/yaBygvx6lEtp1LqEp3aFrF4ez5JSRivNMOGseeN2vK2P15 +qi7flEge0EwpSf30QUWwwz+dzjI6qp9/bobqGvQXdFVey8hv9j0txLhYG5MySCcDV6z tslIgq4KfJ2VTmC2HY2WWzBuc93ZPJG70/G9Mk9rO5O15RzHCQeTIIFRmaliH1faPjVq VKfzA26q02hvYpi7PC3/zWN1A9jg7F05k12IhGLTnrXM83SCuckPYWXgqPvevmGOsXVi XkHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AbkXQEtF; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k19si3411704eja.413.2020.07.27.18.25.39; Mon, 27 Jul 2020 18:26:01 -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=@kernel.org header.s=default header.b=AbkXQEtF; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726800AbgG1BYU (ORCPT + 99 others); Mon, 27 Jul 2020 21:24:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:34074 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726247AbgG1BYU (ORCPT ); Mon, 27 Jul 2020 21:24:20 -0400 Received: from kernel.org (unknown [104.132.0.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 83E6A20809; Tue, 28 Jul 2020 01:24:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595899459; bh=ys14D/WWbTgAMo9tUTXuTr8A1pgEYRarJTsZ+VOuolM=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=AbkXQEtFmkuwJD7v357nl2piay6c727fizXm2rsKN1n7BUqoNIOPPpncYBpCmZLSp 4KLKOMO3AR6xo1DFMF3Q5QZ4LJE806WPR8eKdOcWgNcxP49ei20OwPaO6rzRLpnc+i MtVrHLWyC7MnapG+sYdZn7ihwr/ECboL1VxHTN4g= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20200720122343.178203-1-jingxiangfeng@huawei.com> References: <20200720122343.178203-1-jingxiangfeng@huawei.com> Subject: Re: [PATCH] clk: ti: clkctrl: add the missed kfree() for _ti_omap4_clkctrl_setup() From: Stephen Boyd Cc: linux-omap@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, jingxiangfeng@huawei.com To: Jing Xiangfeng , mturquette@baylibre.com, robh@kernel.org, t-kristo@ti.com, tony@atomide.com Date: Mon, 27 Jul 2020 18:24:18 -0700 Message-ID: <159589945839.1360974.1977401781355555451@swboyd.mtv.corp.google.com> User-Agent: alot/0.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Jing Xiangfeng (2020-07-20 05:23:43) > _ti_omap4_clkctrl_setup() misses to call kfree() in an error path. Add > the missed function call to fix it. >=20 > Fixes: 6c3090520554 ("clk: ti: clkctrl: Fix hidden dependency to node nam= e") > Signed-off-by: Jing Xiangfeng > --- > drivers/clk/ti/clkctrl.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/clk/ti/clkctrl.c b/drivers/clk/ti/clkctrl.c > index 864c484bde1b..868e50132c21 100644 > --- a/drivers/clk/ti/clkctrl.c > +++ b/drivers/clk/ti/clkctrl.c > @@ -655,8 +655,10 @@ static void __init _ti_omap4_clkctrl_setup(struct de= vice_node *node) > } > =20 > hw =3D kzalloc(sizeof(*hw), GFP_KERNEL); > - if (!hw) > + if (!hw) { > + kfree(clkctrl_name); > return; > + } Why not goto cleanup? > =20 > hw->enable_reg.ptr =3D provider->base + reg_data->offset; > =20 > --=20 > 2.17.1 >