From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9D0EC76186 for ; Tue, 23 Jul 2019 16:19:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AC937223BA for ; Tue, 23 Jul 2019 16:19:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HjeaCWML" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732335AbfGWQTJ (ORCPT ); Tue, 23 Jul 2019 12:19:09 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:40677 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728180AbfGWQTJ (ORCPT ); Tue, 23 Jul 2019 12:19:09 -0400 Received: by mail-pf1-f196.google.com with SMTP id p184so19382797pfp.7 for ; Tue, 23 Jul 2019 09:19:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=5cCrOYr2TnsV7hg1z4ufQ0QBSkAleXOLlrvwjgt7a8c=; b=HjeaCWMLzBkFGJqQXljhwWJsnBNJDOLusXlLORvuiIX/zx47EgSI3ZrqqVgboAZcu8 7iWFwjZ5BjM7HIHuANs0ekokz4x8ZTpITs2xKvANVd3ZdXsURbsbuDegN/qvnNVqrN50 V+yZCblOlSH2jvDDHbD2+ADTwZQdrdaxF6WjYfhb9O3diIcqypig3RXF8mycJaRu+YFn OxQbHaICJMlMnqii2Z3EnbN0tuk2udnq7NAWXa6V9vZn/BX+P4a5uj7nY2OAJ/kTwhuJ me2N02/lAa/H/UKkiXS9rATXXHjTdKa5XxSa5Dx/pVfi6TpE16b+jwTThiUQNOqnasNY Qy1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=5cCrOYr2TnsV7hg1z4ufQ0QBSkAleXOLlrvwjgt7a8c=; b=tTn7BucjXNWbzI2iXQECILFcKkEXCZFy84rKN8MiZK7HpdkTRFgbIXYIQLNNF3xSvQ NGS+UVy5tdXgfEp8aN/54FxFMyBTadUUdIoUNnLrwjznWeYAxCSBKSIEOZq86Sonnz74 HwCSJR7mYnQD0o+KKElF/XCsAcinhiLuB7IWl2MMhdzsQxtfrIvDM66XuVk7kLPK1Otr EqQs7KteRhFNL/dy8ojxOY5QxDS6yCPh0eqWMx7qFzEIdFfWVqhjCPzU1FVq7p/uG6rp tiH6tBpWH93z7GqDf/+tRrpv5hKlQoZHCrJDzW0bwQS0Rg+9bNCcOeOuuHvZ2MLDU+/T nmvQ== X-Gm-Message-State: APjAAAVcz9vn8PVTH7t4EocgpLQGuwgzCI+bg4OFooUzx+qQ9tsVCqj1 t+GHmQl7vYDBmgNADc4291E= X-Google-Smtp-Source: APXvYqydcQW2cCafiPIaF7/QZPrBBYpr4qob4CqJ6cgqd3IcA6gfMn0T2uK4ay1hxtAi5OTtmdf/bQ== X-Received: by 2002:a17:90a:21cc:: with SMTP id q70mr85533665pjc.56.1563898748328; Tue, 23 Jul 2019 09:19:08 -0700 (PDT) Received: from hari-Inspiron-1545 ([183.83.86.126]) by smtp.gmail.com with ESMTPSA id e124sm68442200pfh.181.2019.07.23.09.19.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jul 2019 09:19:07 -0700 (PDT) Date: Tue, 23 Jul 2019 21:49:02 +0530 From: Hariprasad Kelam To: Steven Price , 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 Subject: Re: [PATCH] rqchip/stm32: Remove unneeded call to kfree Message-ID: <20190723161902.GA2910@hari-Inspiron-1545> References: <20190719184606.GA4701@hari-Inspiron-1545> <1d9aa4be-4da2-b532-4787-c98869c0bd9d@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1d9aa4be-4da2-b532-4787-c98869c0bd9d@arm.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 22, 2019 at 11:26:09AM +0100, Steven Price wrote: > 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 > Yes thanks for explanation. Please ignore this patch Thanks, Hariprasad k > > return ret; > > } > > > > > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B9C1C76186 for ; Tue, 23 Jul 2019 16:19:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4F6EE20823 for ; Tue, 23 Jul 2019 16:19:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IB40M+Bu"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HjeaCWML" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4F6EE20823 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8JUcSc3TMLFYxFot6zLcmwCQLUIgp0uFpOP3FpGKWfQ=; b=IB40M+Bulu+y+3 SvG9GOqqF0Sqnf9uxKtEikJ89Cs7GrBnGBVkA1CrOyvj//ciKzLGbky4MTzy58YxpW7Cz2xqmeYbS xVI/tstVs7aVPHS+vlN7tD558DKFwwYVM6Gf+am0713A02ZwkSLdRSqfF7z1TDc5qY+xXxboOejb9 eHRbhNTmuZvOUTjqph92qWKcffiROHArRAdSQrnvdhtSq1KDymIb/FafwjmRpwTKTtp52tvQM0Th1 PREdykdHBpMKeEheirXVExgXJ2BK9S4gDjWwxPBQooaLVQEshEasgWHwtF4anIZidOO4/wfQ/AHzy yDr6V9g7hFUa5IlCQ4Iw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hpxVQ-0001j7-Ju; Tue, 23 Jul 2019 16:19:12 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hpxVN-0001iD-DV for linux-arm-kernel@lists.infradead.org; Tue, 23 Jul 2019 16:19:10 +0000 Received: by mail-pf1-x442.google.com with SMTP id u14so19409251pfn.2 for ; Tue, 23 Jul 2019 09:19:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=5cCrOYr2TnsV7hg1z4ufQ0QBSkAleXOLlrvwjgt7a8c=; b=HjeaCWMLzBkFGJqQXljhwWJsnBNJDOLusXlLORvuiIX/zx47EgSI3ZrqqVgboAZcu8 7iWFwjZ5BjM7HIHuANs0ekokz4x8ZTpITs2xKvANVd3ZdXsURbsbuDegN/qvnNVqrN50 V+yZCblOlSH2jvDDHbD2+ADTwZQdrdaxF6WjYfhb9O3diIcqypig3RXF8mycJaRu+YFn OxQbHaICJMlMnqii2Z3EnbN0tuk2udnq7NAWXa6V9vZn/BX+P4a5uj7nY2OAJ/kTwhuJ me2N02/lAa/H/UKkiXS9rATXXHjTdKa5XxSa5Dx/pVfi6TpE16b+jwTThiUQNOqnasNY Qy1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=5cCrOYr2TnsV7hg1z4ufQ0QBSkAleXOLlrvwjgt7a8c=; b=HGnvK2SBwMRFwda6C72bkh+jJQrMbYejY/JERutbxv9pXC2rDWK6T+wpfnPIEya5vF W2HK+XoFsr/t46tPd38fzc7NvYFWuz3L2nY6klUvdzPGJBQS4yOSH9WMjiBbfOba1W7g ZtkkiPNTEkkILKVm2yAOXUeIMVsPpndY2//X2HA+Db8NC4N0VJvLy9cfQqggOsKFwvPc zjkAIKHaNf3xJU+hNPPpFnKvwAitgkkwrL+aLpcDhfUO72VNvG9h5yg1WjHRfQ3Umqt1 1Mu02rsdtLObCFtF0ajS98kqe0GR4boRcPvsJ1AAUutRZW0Ct1mY9z1aacBmJ21FokxJ 30SQ== X-Gm-Message-State: APjAAAXyK06aZjvBYaep6rQOjRX/G0+KV0PAcmsnhSMEx2Eei3ALaZRR rOK6/o0VVv0/rHOzk4oqQG8= X-Google-Smtp-Source: APXvYqydcQW2cCafiPIaF7/QZPrBBYpr4qob4CqJ6cgqd3IcA6gfMn0T2uK4ay1hxtAi5OTtmdf/bQ== X-Received: by 2002:a17:90a:21cc:: with SMTP id q70mr85533665pjc.56.1563898748328; Tue, 23 Jul 2019 09:19:08 -0700 (PDT) Received: from hari-Inspiron-1545 ([183.83.86.126]) by smtp.gmail.com with ESMTPSA id e124sm68442200pfh.181.2019.07.23.09.19.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jul 2019 09:19:07 -0700 (PDT) Date: Tue, 23 Jul 2019 21:49:02 +0530 From: Hariprasad Kelam To: Steven Price , 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 Subject: Re: [PATCH] rqchip/stm32: Remove unneeded call to kfree Message-ID: <20190723161902.GA2910@hari-Inspiron-1545> References: <20190719184606.GA4701@hari-Inspiron-1545> <1d9aa4be-4da2-b532-4787-c98869c0bd9d@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1d9aa4be-4da2-b532-4787-c98869c0bd9d@arm.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190723_091909_458797_8D2E30D5 X-CRM114-Status: GOOD ( 17.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jul 22, 2019 at 11:26:09AM +0100, Steven Price wrote: > 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 > Yes thanks for explanation. Please ignore this patch Thanks, Hariprasad k > > return ret; > > } > > > > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel