ntb.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Wei Yongjun <weiyongjun1@huawei.com>
To: Hulk Robot <hulkci@huawei.com>, Jon Mason <jdmason@kudzu.us>,
	Dave Jiang <dave.jiang@intel.com>,
	Allen Hubbe <allenbh@gmail.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Kishon Vijay Abraham I <kishon@ti.com>
Cc: Wei Yongjun <weiyongjun1@huawei.com>,
	linux-ntb@googlegroups.com, linux-kernel@vger.kernel.org
Subject: [PATCH -next] NTB: Drop kfree for memory allocated with devm_kzalloc
Date: Wed, 10 Feb 2021 07:53:45 +0000	[thread overview]
Message-ID: <20210210075345.1096001-1-weiyongjun1@huawei.com> (raw)

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 <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 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 = {


             reply	other threads:[~2021-02-10  7:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-10  7:53 Wei Yongjun [this message]
2021-02-12 12:48 ` [PATCH -next] NTB: Drop kfree for memory allocated with devm_kzalloc Kishon Vijay Abraham I
2021-02-12 17:45 ` Lorenzo Pieralisi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210210075345.1096001-1-weiyongjun1@huawei.com \
    --to=weiyongjun1@huawei.com \
    --cc=allenbh@gmail.com \
    --cc=dave.jiang@intel.com \
    --cc=hulkci@huawei.com \
    --cc=jdmason@kudzu.us \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-ntb@googlegroups.com \
    --cc=lorenzo.pieralisi@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).