aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUrsula Braun <braunu@de.ibm.com>2007-10-05 10:45:46 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:54:41 -0400
commitd8fae9c2f2642ffe411424ed2e4677f959168152 (patch)
treee037acf17ddb344baa3bbb5c1d9cb398a409d8c8
parent6570ebc4f57ad0761104f769576ae5652d9b8d64 (diff)
qeth: avoid duplicate deletion of multicast addresses
if qeth_set_multicast_list() is performed on 2 CPUs in parallel, card->ip_list may end corrupted. Solution: In function __qeth_delete_all_mc() remove card->ip_list entry before invoking qeth_deregister_addr_entry(). Thus a 2nd invocation of qeth_set_multicast_list() cannot try to remove the same entry twice. Signed-off-by Ursula Braun <braunu@de.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r--drivers/s390/net/qeth_main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c
index fe6164795eda..6d7b79e2ba92 100644
--- a/drivers/s390/net/qeth_main.c
+++ b/drivers/s390/net/qeth_main.c
@@ -823,14 +823,15 @@ __qeth_delete_all_mc(struct qeth_card *card, unsigned long *flags)
823again: 823again:
824 list_for_each_entry_safe(addr, tmp, &card->ip_list, entry) { 824 list_for_each_entry_safe(addr, tmp, &card->ip_list, entry) {
825 if (addr->is_multicast) { 825 if (addr->is_multicast) {
826 list_del(&addr->entry);
826 spin_unlock_irqrestore(&card->ip_lock, *flags); 827 spin_unlock_irqrestore(&card->ip_lock, *flags);
827 rc = qeth_deregister_addr_entry(card, addr); 828 rc = qeth_deregister_addr_entry(card, addr);
828 spin_lock_irqsave(&card->ip_lock, *flags); 829 spin_lock_irqsave(&card->ip_lock, *flags);
829 if (!rc) { 830 if (!rc) {
830 list_del(&addr->entry);
831 kfree(addr); 831 kfree(addr);
832 goto again; 832 goto again;
833 } 833 } else
834 list_add(&addr->entry, &card->ip_list);
834 } 835 }
835 } 836 }
836} 837}