diff options
author | Alex Vesker <valex@mellanox.com> | 2017-06-14 09:59:06 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-06-14 15:16:23 -0400 |
commit | 022d038a163f9e889428789d681b97bf07730fb7 (patch) | |
tree | 290c3df75277d711f118a2795242818473748624 /drivers/infiniband/ulp/ipoib | |
parent | ab156afd3eeb68ce7b875ec8d9ff4f64d1427776 (diff) | |
download | linux-022d038a163f9e889428789d681b97bf07730fb7.tar.gz linux-022d038a163f9e889428789d681b97bf07730fb7.tar.bz2 linux-022d038a163f9e889428789d681b97bf07730fb7.zip |
IB/ipoib: Limit call to free rdma_netdev for capable devices
Limit calls to free_rdma_netdev() for capable devices only.
Fixes: cd565b4b51e5 ('IB/IPoIB: Support acceleration options callbacks')
Signed-off-by: Alex Vesker <valex@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/ulp/ipoib')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_main.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 0ddd9709e1df..91fae34bdd4f 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -2301,7 +2301,10 @@ static void ipoib_remove_one(struct ib_device *device, void *client_data) flush_workqueue(priv->wq); unregister_netdev(priv->dev); - free_netdev(priv->dev); + if (device->free_rdma_netdev) + device->free_rdma_netdev(priv->dev); + else + free_netdev(priv->dev); list_for_each_entry_safe(cpriv, tcpriv, &priv->child_intfs, list) kfree(cpriv); |