mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-11 21:14:07 +08:00
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: 4730f4a6c6
("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>
This commit is contained in:
parent
87d9e56849
commit
193ba03141
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user