Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7001186ybi; Mon, 22 Jul 2019 05:28:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqw980+UKm4SpokJuJrNocg/k6HQt4X7XT2gXKPg1eu4kw1bXwKDimuKYvoBoQYVcBgdbsjq X-Received: by 2002:aa7:9ab5:: with SMTP id x21mr8006pfi.139.1563798512448; Mon, 22 Jul 2019 05:28:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563798512; cv=none; d=google.com; s=arc-20160816; b=oAiqbY48KXN0Z2iqukRebJimFzS2x90gKnUDwOWqTawV0GtgnId56n2JBNj0jM0wqe QIHb/T5MoAkgkTd6ixLhav+E7GC7TZZVtQQWpXsEjiwlMn3YFmQI6aUL+wFIKWldcaiN V+b/bkVcZOy44Qwue3ZAhfp4wy7wdSxa+sm8LDIywndoguSuh0MAm3h2pTOJ/zg+/4jz hFPyb2LhsrDE/WkYXE4DT6baR6ghCEF/gxoI1f4b99tVX1AfCHc1DjfRWIswgEL1Bs7Y /teQfYQpunlI+Nqy2fchj7L0JBOwazD3oqZlDcAMtdz/Ypt0TX/KZGm2JrGIVlWG3g+z Jiug== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject; bh=aCgkDc7yl5h7xWNJeipIVn0CxBA02Xjol3SAkX+e2RI=; b=PaYsKQQjDHG9foYZePJsfZsRVT2sGcRQXbytMuPo8UI8WHwZXnrIQREFlIfkAHqC6I DxKkCS/U4X2knrT1L9t7LWM0rO6NFgd165ddeRuAs3VMhdZ8twWLmT/rR9XjkbWeUAVO oj2gBKdLC/w6acoHWUBPgGnIKOxUdpf4r8GyhHkfuYtmPaSCsmVRANtc4avdrD6jipKT Tg6s2ylGE5xTdLA5Ur2qtrv6IHEBeSJ8yXFZOZJWtdqvdaEm7Fa+gCg1jrn1GMvxR0k0 yqZJPgSKjN/YtUSzGBdGNUZ8Tv6v0gIfZHFpkf91+RCIiFWUeUic1FX9whRquPspaoZJ QKmw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o12si8677288pgl.448.2019.07.22.05.28.16; Mon, 22 Jul 2019 05:28:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729537AbfGVK0N (ORCPT + 99 others); Mon, 22 Jul 2019 06:26:13 -0400 Received: from foss.arm.com ([217.140.110.172]:35182 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726846AbfGVK0N (ORCPT ); Mon, 22 Jul 2019 06:26:13 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6B0FD28; Mon, 22 Jul 2019 03:26:12 -0700 (PDT) Received: from [10.1.196.133] (e112269-lin.cambridge.arm.com [10.1.196.133]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0D4AE3F71A; Mon, 22 Jul 2019 03:26:10 -0700 (PDT) Subject: Re: [PATCH] rqchip/stm32: Remove unneeded call to kfree To: Hariprasad Kelam , Thomas Gleixner , Jason Cooper , Marc Zyngier , Maxime Coquelin , Alexandre Torgue , linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org References: <20190719184606.GA4701@hari-Inspiron-1545> From: Steven Price Message-ID: <1d9aa4be-4da2-b532-4787-c98869c0bd9d@arm.com> Date: Mon, 22 Jul 2019 11:26:09 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190719184606.GA4701@hari-Inspiron-1545> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/07/2019 19:46, Hariprasad Kelam wrote: > Memory allocated by devm_ alloc will be freed upon device detachment. So > we may not require free memory. > > Signed-off-by: Hariprasad Kelam > --- > drivers/irqchip/irq-stm32-exti.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/irqchip/irq-stm32-exti.c b/drivers/irqchip/irq-stm32-exti.c > index e00f2fa..46ec0af 100644 > --- a/drivers/irqchip/irq-stm32-exti.c > +++ b/drivers/irqchip/irq-stm32-exti.c > @@ -779,8 +779,6 @@ static int __init stm32_exti_init(const struct stm32_exti_drv_data *drv_data, > irq_domain_remove(domain); > out_unmap: > iounmap(host_data->base); > - kfree(host_data->chips_data); > - kfree(host_data); In the commit this is based on these variables are not allocated using a devm_ alloc function: $ git show e00f2fa | grep -A12 *stm32_exti_host_init > stm32_exti_host_data *stm32_exti_host_init(const struct stm32_exti_drv_data *dd, > struct device_node *node) > { > struct stm32_exti_host_data *host_data; > > host_data = kzalloc(sizeof(*host_data), GFP_KERNEL); > if (!host_data) > return NULL; > > host_data->drv_data = dd; > host_data->chips_data = kcalloc(dd->bank_nr, > sizeof(struct stm32_exti_chip_data), > GFP_KERNEL); The function stm32_exti_probe *does* use devm_k?alloc, so perhaps you were getting confused with that? Steve > return ret; > } > >