Commit c96f60e4 authored by Herbert Xu's avatar Herbert Xu Committed by James Morris

[IPV4]: inetdev ifa_list handling fixes for s390 drivers

Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@redhat.com>
parent 91dfe8ef
...@@ -1002,7 +1002,7 @@ lcs_register_mc_addresses(void *data) ...@@ -1002,7 +1002,7 @@ lcs_register_mc_addresses(void *data)
in4_dev = in_dev_get(card->dev); in4_dev = in_dev_get(card->dev);
if (in4_dev == NULL) if (in4_dev == NULL)
return 0; return 0;
read_lock(&in4_dev->lock); read_lock(&in4_dev->mc_list_lock);
spin_lock(&card->ipm_lock); spin_lock(&card->ipm_lock);
/* Check for multicast addresses to be removed. */ /* Check for multicast addresses to be removed. */
list_for_each(l, &card->ipm_list) { list_for_each(l, &card->ipm_list) {
...@@ -1046,7 +1046,7 @@ lcs_register_mc_addresses(void *data) ...@@ -1046,7 +1046,7 @@ lcs_register_mc_addresses(void *data)
list_add(&ipm->list, &card->ipm_list); list_add(&ipm->list, &card->ipm_list);
} }
spin_unlock(&card->ipm_lock); spin_unlock(&card->ipm_lock);
read_unlock(&in4_dev->lock); read_unlock(&in4_dev->mc_list_lock);
in_dev_put(in4_dev); in_dev_put(in4_dev);
lcs_fix_multicast_list(card); lcs_fix_multicast_list(card);
return 0; return 0;
......
...@@ -73,6 +73,7 @@ qeth_eyecatcher(void) ...@@ -73,6 +73,7 @@ qeth_eyecatcher(void)
#include <linux/reboot.h> #include <linux/reboot.h>
#include <asm/qeth.h> #include <asm/qeth.h>
#include <linux/mii.h> #include <linux/mii.h>
#include <linux/rcupdate.h>
#include "qeth.h" #include "qeth.h"
#include "qeth_mpc.h" #include "qeth_mpc.h"
...@@ -4733,9 +4734,10 @@ qeth_free_vlan_addresses4(struct qeth_card *card, unsigned short vid) ...@@ -4733,9 +4734,10 @@ qeth_free_vlan_addresses4(struct qeth_card *card, unsigned short vid)
QETH_DBF_TEXT(trace, 4, "frvaddr4"); QETH_DBF_TEXT(trace, 4, "frvaddr4");
if (!card->vlangrp) if (!card->vlangrp)
return; return;
in_dev = in_dev_get(card->vlangrp->vlan_devices[vid]); rcu_read_lock();
in_dev = __in_dev_get(card->vlangrp->vlan_devices[vid]);
if (!in_dev) if (!in_dev)
return; goto out;
for (ifa = in_dev->ifa_list; ifa; ifa = ifa->ifa_next){ for (ifa = in_dev->ifa_list; ifa; ifa = ifa->ifa_next){
addr = qeth_get_addr_buffer(QETH_PROT_IPV4); addr = qeth_get_addr_buffer(QETH_PROT_IPV4);
if (addr){ if (addr){
...@@ -4746,7 +4748,8 @@ qeth_free_vlan_addresses4(struct qeth_card *card, unsigned short vid) ...@@ -4746,7 +4748,8 @@ qeth_free_vlan_addresses4(struct qeth_card *card, unsigned short vid)
kfree(addr); kfree(addr);
} }
} }
in_dev_put(in_dev); out:
rcu_read_unlock();
} }
static void static void
...@@ -4918,9 +4921,9 @@ qeth_add_vlan_mc(struct qeth_card *card) ...@@ -4918,9 +4921,9 @@ qeth_add_vlan_mc(struct qeth_card *card)
in_dev = in_dev_get(vg->vlan_devices[i]); in_dev = in_dev_get(vg->vlan_devices[i]);
if (!in_dev) if (!in_dev)
continue; continue;
read_lock(&in_dev->lock); read_lock(&in_dev->mc_list_lock);
qeth_add_mc(card,in_dev); qeth_add_mc(card,in_dev);
read_unlock(&in_dev->lock); read_unlock(&in_dev->mc_list_lock);
in_dev_put(in_dev); in_dev_put(in_dev);
} }
#endif #endif
...@@ -4935,10 +4938,10 @@ qeth_add_multicast_ipv4(struct qeth_card *card) ...@@ -4935,10 +4938,10 @@ qeth_add_multicast_ipv4(struct qeth_card *card)
in4_dev = in_dev_get(card->dev); in4_dev = in_dev_get(card->dev);
if (in4_dev == NULL) if (in4_dev == NULL)
return; return;
read_lock(&in4_dev->lock); read_lock(&in4_dev->mc_list_lock);
qeth_add_mc(card, in4_dev); qeth_add_mc(card, in4_dev);
qeth_add_vlan_mc(card); qeth_add_vlan_mc(card);
read_unlock(&in4_dev->lock); read_unlock(&in4_dev->mc_list_lock);
in_dev_put(in4_dev); in_dev_put(in4_dev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment