Commit 193ba031 authored by YueHaibing's avatar YueHaibing Committed by Jason Gunthorpe

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: 4730f4a6 ("IB/hfi1: Activate the dummy netdev")
Link: https://lore.kernel.org/r/20200602061635.31224-1-yuehaibing@huawei.comSigned-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Reported-by: default avatarkbuild test robot <lkp@intel.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 87d9e568
...@@ -371,12 +371,9 @@ int hfi1_netdev_alloc(struct hfi1_devdata *dd) ...@@ -371,12 +371,9 @@ int hfi1_netdev_alloc(struct hfi1_devdata *dd)
void hfi1_netdev_free(struct hfi1_devdata *dd) void hfi1_netdev_free(struct hfi1_devdata *dd)
{ {
struct hfi1_netdev_priv *priv;
if (dd->dummy_netdev) { if (dd->dummy_netdev) {
priv = hfi1_netdev_priv(dd->dummy_netdev);
dd_dev_info(dd, "hfi1 netdev freed\n"); dd_dev_info(dd, "hfi1 netdev freed\n");
kfree(dd->dummy_netdev); free_netdev(dd->dummy_netdev);
dd->dummy_netdev = NULL; dd->dummy_netdev = NULL;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment