Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp27631ybg; Mon, 27 Jul 2020 20:44:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfKGaI0urlUEFWj431761qVv39snRXgBfzjfaR0KP3RuKLDmpJDWYUTFbfhllqW1t28wC2 X-Received: by 2002:a50:ccd0:: with SMTP id b16mr3682821edj.148.1595907877181; Mon, 27 Jul 2020 20:44:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595907877; cv=none; d=google.com; s=arc-20160816; b=HGGHXnu29m1lL7KoaCb9aBO8llaf+6LcYWyxVX9wbB4I7k51y4VzTQ2A71uBLijoFX 7OLj+lhffA2NdXujWni9UE2/bdqPOgdnDPAX+XfCsMhm3MRKCYzELH3HijOnsc56cUgf 04h0B6JLEEqWEifxD3sSHdz7WOBMdZZMgVNRACN1kXpFlae4TjFdUE2rDIJaXUF+2WQS hMECK043R2cSstaGGv7rDRi1RqJ+gONhIzhnI4ADUygFbqloIcOKyL+CX2/IRoIBd82q /kYbE4OaF233PllMdVns4VPo5+cw5ylPY0MqBYkScwlq0RIFUL0yU/lNLNzFILrFQBTI Yarg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=TQ3k8Z9BcMCcA3qVjKHKX1ZeuoDA40UYuTB0h4b9678=; b=j/rEhEZJ4Hf9C6vJVhfWx0jJaHmoNlvPLHI/u/7sPdtc16KR4vA8as7qfoeYyWmckY iTotdF68oo0QMtIXj6CILDkigwt0+ODXHspPUQbp4UpbW2pGYVtKqWFaqXhwXm8Su51M Pc+G4MynyxXNTdfPtilTJhs0FPjDO6Cyt3221NyzlW9BQr9frtdrt1saPTOsn2b3Pas4 RFzLyHHhKX6MtUw0HjfJ1gMNqMG4M4q5XbGhWYVwcxBpyG/lUMWPIwzCx9oyj3cjt6cL fOqEtXTgIXuF/PkJhst4v1kv1iGfE77idVa6VFUpM9kyNMafBIlmB2k1TgBBpGsIxAdM r9og== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g26si6708986edv.376.2020.07.27.20.44.14; Mon, 27 Jul 2020 20:44:37 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726899AbgG1DoB (ORCPT + 99 others); Mon, 27 Jul 2020 23:44:01 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:8834 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726782AbgG1DoB (ORCPT ); Mon, 27 Jul 2020 23:44:01 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 34EDD7B55506FB966D52; Tue, 28 Jul 2020 11:43:58 +0800 (CST) Received: from [10.174.179.105] (10.174.179.105) by smtp.huawei.com (10.3.19.209) with Microsoft SMTP Server (TLS) id 14.3.487.0; Tue, 28 Jul 2020 11:43:57 +0800 Subject: Re: [PATCH] clk: ti: clkctrl: add the missed kfree() for _ti_omap4_clkctrl_setup() To: Stephen Boyd , , , , References: <20200720122343.178203-1-jingxiangfeng@huawei.com> <159589945839.1360974.1977401781355555451@swboyd.mtv.corp.google.com> CC: , , From: Jing Xiangfeng Message-ID: <5F1F9EF8.6090304@huawei.com> Date: Tue, 28 Jul 2020 11:43:52 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <159589945839.1360974.1977401781355555451@swboyd.mtv.corp.google.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.105] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/7/28 9:24, Stephen Boyd wrote: > 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. >> >> Fixes: 6c3090520554 ("clk: ti: clkctrl: Fix hidden dependency to node name") >> Signed-off-by: Jing Xiangfeng >> --- >> drivers/clk/ti/clkctrl.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> 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 device_node *node) >> } >> >> hw = kzalloc(sizeof(*hw), GFP_KERNEL); >> - if (!hw) >> + if (!hw) { >> + kfree(clkctrl_name); >> return; >> + } > > Why not goto cleanup? Thanks, I will change it as you suggested. > >> >> hw->enable_reg.ptr = provider->base + reg_data->offset; >> >> -- >> 2.17.1 >> > . >