diff options
author | Jason Gunthorpe <jgg@mellanox.com> | 2018-07-29 11:34:53 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-08-03 05:27:43 +0300 |
commit | 7cbee87c17965ede0eba2e7ba41d0a38ebd2249c (patch) | |
tree | 19564debc7437d5e1189cfeec34d977a83dc9944 /drivers/infiniband/ulp/ipoib/ipoib_vlan.c | |
parent | cda8daf17914a261986d6d4b7294599736d5a463 (diff) | |
download | linux-7cbee87c17965ede0eba2e7ba41d0a38ebd2249c.tar.xz |
IB/ipoib: Move all uninit code into ndo_uninit
Currently uninit is sometimes done twice in error flows, and is sprinkled
a bit all over the place.
Improve the clarity of the design by moving all uninit only into
ndo_uinit.
Some duplication is removed:
- Sometimes IPOIB_STOP_NEIGH_GC was done before unregister, but
this duplicates the process in ipoib_neigh_hash_init
- Flushing priv->wq was sometimes done before unregister,
but that duplicates what has been done in ndo_uninit
Uniniting the IB event queue must remain before unregister_netdev as it
requires the RTNL lock to be dropped, this is moved to a helper to make
that flow really clear and remove some duplication in error flows.
If register_netdev fails (and ndo_init is NULL) then it almost always
calls ndo_uninit, which lets us remove all the extra code from the error
unwinds. The next patch in the series will close the 'almost always' hole
by pairing a proper ndo_init with ndo_uninit.
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Diffstat (limited to 'drivers/infiniband/ulp/ipoib/ipoib_vlan.c')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_vlan.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_vlan.c b/drivers/infiniband/ulp/ipoib/ipoib_vlan.c index 1b7bfd500893..b62ab85c8ead 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_vlan.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_vlan.c @@ -83,7 +83,7 @@ int __ipoib_vlan_add(struct ipoib_dev_priv *ppriv, struct ipoib_dev_priv *priv, result = register_netdevice(priv->dev); if (result) { ipoib_warn(priv, "failed to initialize; error %i", result); - goto register_failed; + goto err; } /* RTNL childs don't need proprietary sysfs entries */ @@ -108,9 +108,6 @@ sysfs_failed: result = -ENOMEM; unregister_netdevice(priv->dev); -register_failed: - ipoib_dev_cleanup(priv->dev); - err: return result; } |