summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/ipoib/ipoib_vlan.c
diff options
context:
space:
mode:
authorAlex Vesker <valex@mellanox.com>2017-06-14 09:59:05 +0300
committerDoug Ledford <dledford@redhat.com>2017-06-14 15:16:23 -0400
commitab156afd3eeb68ce7b875ec8d9ff4f64d1427776 (patch)
tree9014b103ba5ce826a98c2f2d43b99bad6f3b4b2f /drivers/infiniband/ulp/ipoib/ipoib_vlan.c
parent07d432bb97f19dd5e784175152f9fce3b2646133 (diff)
downloadop-kernel-dev-ab156afd3eeb68ce7b875ec8d9ff4f64d1427776.zip
op-kernel-dev-ab156afd3eeb68ce7b875ec8d9ff4f64d1427776.tar.gz
IB/ipoib: Fix memory leaks for child interfaces priv
There is a need to free priv explicitly and not just to release the device, child priv is freed explicitly on remove flow and this patch also includes priv free on error flow in P_key creation and also in add_port. 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/ipoib_vlan.c')
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_vlan.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_vlan.c b/drivers/infiniband/ulp/ipoib/ipoib_vlan.c
index 36dc4fc..1ee4619 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_vlan.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_vlan.c
@@ -167,8 +167,10 @@ out:
rtnl_unlock();
- if (result)
+ if (result) {
free_netdev(priv->dev);
+ kfree(priv);
+ }
return result;
}
@@ -209,6 +211,7 @@ int ipoib_vlan_delete(struct net_device *pdev, unsigned short pkey)
if (dev) {
free_netdev(dev);
+ kfree(priv);
return 0;
}
OpenPOWER on IntegriCloud