Skip to content

Commit

Permalink
qeth: avoid duplicate deletion of multicast addresses
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ursula Braun authored and David S. Miller committed Oct 10, 2007
1 parent 6570ebc commit d8fae9c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/s390/net/qeth_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -823,14 +823,15 @@ __qeth_delete_all_mc(struct qeth_card *card, unsigned long *flags)
again:
list_for_each_entry_safe(addr, tmp, &card->ip_list, entry) {
if (addr->is_multicast) {
list_del(&addr->entry);
spin_unlock_irqrestore(&card->ip_lock, *flags);
rc = qeth_deregister_addr_entry(card, addr);
spin_lock_irqsave(&card->ip_lock, *flags);
if (!rc) {
list_del(&addr->entry);
kfree(addr);
goto again;
}
} else
list_add(&addr->entry, &card->ip_list);
}
}
}
Expand Down

0 comments on commit d8fae9c

Please sign in to comment.