summaryrefslogtreecommitdiff
path: root/drivers/infiniband/hw/hfi1
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2020-06-02 09:16:35 +0300
committerJason Gunthorpe <jgg@mellanox.com>2020-06-03 03:35:03 +0300
commit193ba03141bb987c3af985f6479840030fec0534 (patch)
treefaa6b64b28342069cc83cf5807a1483b5433f78a /drivers/infiniband/hw/hfi1
parent87d9e568496aeb519f1da61f54ac0dcb8d37561e (diff)
downloadlinux-193ba03141bb987c3af985f6479840030fec0534.tar.xz
IB/hfi1: Use free_netdev() in hfi1_netdev_free()
dummy_netdev shold be freed by free_netdev() instead of kfree(). Also remove unneeded variable 'priv' Fixes: 4730f4a6c6b2 ("IB/hfi1: Activate the dummy netdev") Link: https://lore.kernel.org/r/20200602061635.31224-1-yuehaibing@huawei.com Signed-off-by: YueHaibing <yuehaibing@huawei.com> Reported-by: kbuild test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/hw/hfi1')
-rw-r--r--drivers/infiniband/hw/hfi1/netdev_rx.c5
1 files changed, 1 insertions, 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;
}
}