diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2009-01-22 04:03:02 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2009-01-22 04:03:02 -0500 |
commit | 6552ebae25ffd57574c6e72d17fce67fea08b918 (patch) | |
tree | cde6cc932c7e47d818154b011dfd8a6997d5c18e /drivers/infiniband/ulp/ipoib/ipoib_vlan.c | |
parent | 749a440b2218e9937dca8c68e23e51ca4d8d37fe (diff) | |
parent | 336f6c322d87806ef93afad6308ac65083a865e5 (diff) |
Merge branch 'core/debugobjects' into core/urgent
Diffstat (limited to 'drivers/infiniband/ulp/ipoib/ipoib_vlan.c')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_vlan.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_vlan.c b/drivers/infiniband/ulp/ipoib/ipoib_vlan.c index 2cf1a4088718..5a76a5510350 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_vlan.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_vlan.c | |||
@@ -61,6 +61,7 @@ int ipoib_vlan_add(struct net_device *pdev, unsigned short pkey) | |||
61 | 61 | ||
62 | ppriv = netdev_priv(pdev); | 62 | ppriv = netdev_priv(pdev); |
63 | 63 | ||
64 | rtnl_lock(); | ||
64 | mutex_lock(&ppriv->vlan_mutex); | 65 | mutex_lock(&ppriv->vlan_mutex); |
65 | 66 | ||
66 | /* | 67 | /* |
@@ -111,7 +112,7 @@ int ipoib_vlan_add(struct net_device *pdev, unsigned short pkey) | |||
111 | goto device_init_failed; | 112 | goto device_init_failed; |
112 | } | 113 | } |
113 | 114 | ||
114 | result = register_netdev(priv->dev); | 115 | result = register_netdevice(priv->dev); |
115 | if (result) { | 116 | if (result) { |
116 | ipoib_warn(priv, "failed to initialize; error %i", result); | 117 | ipoib_warn(priv, "failed to initialize; error %i", result); |
117 | goto register_failed; | 118 | goto register_failed; |
@@ -134,12 +135,13 @@ int ipoib_vlan_add(struct net_device *pdev, unsigned short pkey) | |||
134 | list_add_tail(&priv->list, &ppriv->child_intfs); | 135 | list_add_tail(&priv->list, &ppriv->child_intfs); |
135 | 136 | ||
136 | mutex_unlock(&ppriv->vlan_mutex); | 137 | mutex_unlock(&ppriv->vlan_mutex); |
138 | rtnl_unlock(); | ||
137 | 139 | ||
138 | return 0; | 140 | return 0; |
139 | 141 | ||
140 | sysfs_failed: | 142 | sysfs_failed: |
141 | ipoib_delete_debug_files(priv->dev); | 143 | ipoib_delete_debug_files(priv->dev); |
142 | unregister_netdev(priv->dev); | 144 | unregister_netdevice(priv->dev); |
143 | 145 | ||
144 | register_failed: | 146 | register_failed: |
145 | ipoib_dev_cleanup(priv->dev); | 147 | ipoib_dev_cleanup(priv->dev); |
@@ -149,6 +151,7 @@ device_init_failed: | |||
149 | 151 | ||
150 | err: | 152 | err: |
151 | mutex_unlock(&ppriv->vlan_mutex); | 153 | mutex_unlock(&ppriv->vlan_mutex); |
154 | rtnl_unlock(); | ||
152 | return result; | 155 | return result; |
153 | } | 156 | } |
154 | 157 | ||
@@ -162,10 +165,11 @@ int ipoib_vlan_delete(struct net_device *pdev, unsigned short pkey) | |||
162 | 165 | ||
163 | ppriv = netdev_priv(pdev); | 166 | ppriv = netdev_priv(pdev); |
164 | 167 | ||
168 | rtnl_lock(); | ||
165 | mutex_lock(&ppriv->vlan_mutex); | 169 | mutex_lock(&ppriv->vlan_mutex); |
166 | list_for_each_entry_safe(priv, tpriv, &ppriv->child_intfs, list) { | 170 | list_for_each_entry_safe(priv, tpriv, &ppriv->child_intfs, list) { |
167 | if (priv->pkey == pkey) { | 171 | if (priv->pkey == pkey) { |
168 | unregister_netdev(priv->dev); | 172 | unregister_netdevice(priv->dev); |
169 | ipoib_dev_cleanup(priv->dev); | 173 | ipoib_dev_cleanup(priv->dev); |
170 | list_del(&priv->list); | 174 | list_del(&priv->list); |
171 | free_netdev(priv->dev); | 175 | free_netdev(priv->dev); |
@@ -175,6 +179,7 @@ int ipoib_vlan_delete(struct net_device *pdev, unsigned short pkey) | |||
175 | } | 179 | } |
176 | } | 180 | } |
177 | mutex_unlock(&ppriv->vlan_mutex); | 181 | mutex_unlock(&ppriv->vlan_mutex); |
182 | rtnl_unlock(); | ||
178 | 183 | ||
179 | return ret; | 184 | return ret; |
180 | } | 185 | } |