Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2924502pxb; Fri, 12 Feb 2021 05:11:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJyhXe8qKAOTTL/uUKb6Psxsu42nLRE31Uw3cYd2jlb0l1TcHyE9YGuAZZ88f+h30BrYjoKa X-Received: by 2002:a05:6402:2707:: with SMTP id y7mr3234802edd.5.1613135469459; Fri, 12 Feb 2021 05:11:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613135469; cv=none; d=google.com; s=arc-20160816; b=UktTTvvD42gPey8EWX7KiNvZQhyxN+3658tKKevQUIAeYzKDcO41tpsNVeDr17uFLj uYukkTi9izj/D5CRbbIc6kQKBGzvU4o/0qI3x/Gqn/fRr2urf9r4h0zlPrGebO4ZsSnm R0YCrW+UQaCmhIYGCvLVhc13d3C+BnzKOocSbHXfUeJ0supY4aWzkwb14nW0ArbFA3fr mSkwD+W+Wq+8ik+jGFmf+KaujAZ+ZtSBlHXgporNVE0oS6g2Wo4C66MLHm1VoiQd1kmr VPB7LoxG8v1bln/xE1q6tQrFfzzACabPyLwPvn6/0xRGYYD9i2HhUm1N+/PJ5j51Nh0b RrEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=SFCHRJEZKuC8tAGhsa/pKFsCkhYCR9NZsOPbGEoRRKU=; b=m5dLkojefPwuG/8ge7/ozKrkSCJzucZabXHja56NDgFZJ8Ak3nnt13zB41XgK/Z0F2 QU6eXyvuWVl7M4lvJJxpbe2pD0G/vEvtXKD65rpqUZrOe8MneyRRGA4sADO58isOob34 RZ575tekGI8lQ32oqcpWXnYHvK1Yg5mCWeLcimXoe8l01RkttKzxpGRI9jKv/Kzj2KhH Mq1Vo6X3vIiHm4X1asFL/B3+/wkJIG00jRMysXuo+OvnLcRawRUxcw9gZw94G1+DgNoP bxwtQwqvH4spgXlRNAbCu0LbW1pzfXyEIJxQhukrrFlQag8wI2vLxSae0i2oW4GAxC89 LaRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=cCtjL3XP; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c21si6247657eja.329.2021.02.12.05.10.46; Fri, 12 Feb 2021 05:11:09 -0800 (PST) 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=@ti.com header.s=ti-com-17Q1 header.b=cCtjL3XP; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232078AbhBLNKE (ORCPT + 99 others); Fri, 12 Feb 2021 08:10:04 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:35142 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231178AbhBLMto (ORCPT ); Fri, 12 Feb 2021 07:49:44 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 11CCmZwY071475; Fri, 12 Feb 2021 06:48:35 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1613134115; bh=SFCHRJEZKuC8tAGhsa/pKFsCkhYCR9NZsOPbGEoRRKU=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=cCtjL3XPG0iph9XzEB20haUA3QdIq3oGP9G1scv101jW+MRMWO8Hitk3qwl6f0fS+ bJG/4KPV7Mv/RPc8lp3jRxOP7L8QxNbiORUx0kuqBGLbbms5iaD+OSM+1yq1Ee3T+I drl514DiBkNuqt18k8gvM92JdFuYehcNpftl/nIk= Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 11CCmZuq071363 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 12 Feb 2021 06:48:35 -0600 Received: from DLEE100.ent.ti.com (157.170.170.30) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Fri, 12 Feb 2021 06:48:35 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Fri, 12 Feb 2021 06:48:35 -0600 Received: from [10.250.234.16] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 11CCmVXk037765; Fri, 12 Feb 2021 06:48:32 -0600 Subject: Re: [PATCH -next] NTB: Drop kfree for memory allocated with devm_kzalloc To: Wei Yongjun , Hulk Robot , Jon Mason , Dave Jiang , Allen Hubbe , Lorenzo Pieralisi CC: , , Kishon Vijay Abraham I References: <20210210075345.1096001-1-weiyongjun1@huawei.com> From: Kishon Vijay Abraham I Message-ID: Date: Fri, 12 Feb 2021 18:18:31 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210210075345.1096001-1-weiyongjun1@huawei.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/02/21 1:23 pm, Wei Yongjun wrote: > It's not necessary to free memory allocated with devm_kzalloc > and using kfree leads to a double free. > > Fixes: 363baf7d6051 ("NTB: Add support for EPF PCI-Express Non-Transparent Bridge") > Reported-by: Hulk Robot > Signed-off-by: Wei Yongjun > --- > drivers/ntb/hw/epf/ntb_hw_epf.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/ntb/hw/epf/ntb_hw_epf.c b/drivers/ntb/hw/epf/ntb_hw_epf.c > index 2cccb7dff5dd..b019755e4e21 100644 > --- a/drivers/ntb/hw/epf/ntb_hw_epf.c > +++ b/drivers/ntb/hw/epf/ntb_hw_epf.c > @@ -723,7 +723,6 @@ static void ntb_epf_pci_remove(struct pci_dev *pdev) > ntb_unregister_device(&ndev->ntb); > ntb_epf_cleanup_isr(ndev); > ntb_epf_deinit_pci(ndev); > - kfree(ndev); > } Reviewed-by: Kishon Vijay Abraham I > > static const struct ntb_epf_data j721e_data = { >