sched/headers: Prepare to move signal wakeup & sigpending methods from <linux/sched...
[linux-2.6-block.git] / drivers / infiniband / ulp / ipoib / ipoib_vlan.c
index fd811115af49ca23c4a5ebbcb3536c589fa056a0..3e10e3dac2e7f51ba366c185e0d898db0b127857 100644 (file)
@@ -31,6 +31,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/sched/signal.h>
 
 #include <linux/init.h>
 #include <linux/seq_file.h>
@@ -61,9 +62,7 @@ int __ipoib_vlan_add(struct ipoib_dev_priv *ppriv, struct ipoib_dev_priv *priv,
        priv->parent = ppriv->dev;
        set_bit(IPOIB_FLAG_SUBINTERFACE, &priv->flags);
 
-       result = ipoib_set_dev_features(priv, ppriv->ca);
-       if (result)
-               goto err;
+       ipoib_set_dev_features(priv, ppriv->ca);
 
        priv->pkey = pkey;
 
@@ -168,11 +167,11 @@ int ipoib_vlan_add(struct net_device *pdev, unsigned short pkey)
 out:
        up_write(&ppriv->vlan_rwsem);
 
+       rtnl_unlock();
+
        if (result)
                free_netdev(priv->dev);
 
-       rtnl_unlock();
-
        return result;
 }
 
@@ -196,7 +195,6 @@ int ipoib_vlan_delete(struct net_device *pdev, unsigned short pkey)
        list_for_each_entry_safe(priv, tpriv, &ppriv->child_intfs, list) {
                if (priv->pkey == pkey &&
                    priv->child_type == IPOIB_LEGACY_CHILD) {
-                       unregister_netdevice(priv->dev);
                        list_del(&priv->list);
                        dev = priv->dev;
                        break;
@@ -204,6 +202,11 @@ int ipoib_vlan_delete(struct net_device *pdev, unsigned short pkey)
        }
        up_write(&ppriv->vlan_rwsem);
 
+       if (dev) {
+               ipoib_dbg(ppriv, "delete child vlan %s\n", dev->name);
+               unregister_netdevice(dev);
+       }
+
        rtnl_unlock();
 
        if (dev) {