From: YueHaibing <yuehaibing@huawei.com>
To: <mike.marciniszyn@intel.com>, <dennis.dalessandro@intel.com>,
<dledford@redhat.com>, <jgg@ziepe.ca>,
<sadanand.warrier@intel.com>, <grzegorz.andrejczuk@intel.com>,
<yuehaibing@huawei.com>
Cc: <linux-rdma@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<dan.carpenter@oracle.com>, <kernel-janitors@vger.kernel.org>
Subject: [PATCH -next] IB/hfi1: Use free_netdev() in hfi1_netdev_free()
Date: Tue, 2 Jun 2020 14:16:35 +0800 [thread overview]
Message-ID: <20200602061635.31224-1-yuehaibing@huawei.com> (raw)
In-Reply-To: <20200601135644.GD4872@ziepe.ca>
dummy_netdev shold be freed by free_netdev() instead of
kfree(). Also remove unneeded variable 'priv'
Fixes: 4730f4a6c6b2 ("IB/hfi1: Activate the dummy netdev")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
drivers/infiniband/hw/hfi1/netdev_rx.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/infiniband/hw/hfi1/netdev_rx.c b/drivers/infiniband/hw/hfi1/netdev_rx.c
index 58af6a454761..63688e85e8da 100644
--- a/drivers/infiniband/hw/hfi1/netdev_rx.c
+++ b/drivers/infiniband/hw/hfi1/netdev_rx.c
@@ -371,12 +371,9 @@ int hfi1_netdev_alloc(struct hfi1_devdata *dd)
void hfi1_netdev_free(struct hfi1_devdata *dd)
{
- struct hfi1_netdev_priv *priv;
-
if (dd->dummy_netdev) {
- priv = hfi1_netdev_priv(dd->dummy_netdev);
dd_dev_info(dd, "hfi1 netdev freed\n");
- kfree(dd->dummy_netdev);
+ free_netdev(dd->dummy_netdev);
dd->dummy_netdev = NULL;
}
}
--
2.17.1
next parent reply other threads:[~2020-06-02 6:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200601135644.GD4872@ziepe.ca>
2020-06-02 6:16 ` YueHaibing [this message]
2020-06-02 15:30 ` [PATCH -next] IB/hfi1: Use free_netdev() in hfi1_netdev_free() Dennis Dalessandro
2020-06-02 18:38 ` Dan Carpenter
2020-06-03 0:36 ` Jason Gunthorpe
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=20200602061635.31224-1-yuehaibing@huawei.com \
--to=yuehaibing@huawei.com \
--cc=dan.carpenter@oracle.com \
--cc=dennis.dalessandro@intel.com \
--cc=dledford@redhat.com \
--cc=grzegorz.andrejczuk@intel.com \
--cc=jgg@ziepe.ca \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mike.marciniszyn@intel.com \
--cc=sadanand.warrier@intel.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).