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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 C2C22C433E0 for ; Wed, 10 Feb 2021 07:47:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8BBAC64E45 for ; Wed, 10 Feb 2021 07:47:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233009AbhBJHrQ (ORCPT ); Wed, 10 Feb 2021 02:47:16 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:12605 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232903AbhBJHqB (ORCPT ); Wed, 10 Feb 2021 02:46:01 -0500 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DbBbH46dMz165vT; Wed, 10 Feb 2021 15:43:55 +0800 (CST) Received: from localhost.localdomain (10.175.102.38) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.498.0; Wed, 10 Feb 2021 15:45:12 +0800 From: Wei Yongjun To: Hulk Robot , Jon Mason , Dave Jiang , Allen Hubbe , Lorenzo Pieralisi , Kishon Vijay Abraham I CC: Wei Yongjun , , Subject: [PATCH -next] NTB: Drop kfree for memory allocated with devm_kzalloc Date: Wed, 10 Feb 2021 07:53:45 +0000 Message-ID: <20210210075345.1096001-1-weiyongjun1@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Originating-IP: [10.175.102.38] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); } static const struct ntb_epf_data j721e_data = {