diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-03-09 14:09:08 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-03-10 10:32:28 -0500 |
commit | 3041f5170751e3522aa1bd6e8ca5d98e846720b0 (patch) | |
tree | f692b5193501ff8d3f6895321f936895980e6761 | |
parent | 0a141509ede48ac33ef756ac1640f4d3f46fa2db (diff) |
net: Fix dev_mc_add()
Commit 6e17d45a (net: add addr len check to dev_mc_add)
added a bug in dev_mc_add(), since it can now exit with a lock
imbalance.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/core/dev_mcast.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/core/dev_mcast.c b/net/core/dev_mcast.c index fd91569e2394..3dc295beb483 100644 --- a/net/core/dev_mcast.c +++ b/net/core/dev_mcast.c | |||
@@ -97,8 +97,9 @@ int dev_mc_add(struct net_device *dev, void *addr, int alen, int glbl) | |||
97 | 97 | ||
98 | netif_addr_lock_bh(dev); | 98 | netif_addr_lock_bh(dev); |
99 | if (alen != dev->addr_len) | 99 | if (alen != dev->addr_len) |
100 | return -EINVAL; | 100 | err = -EINVAL; |
101 | err = __dev_addr_add(&dev->mc_list, &dev->mc_count, addr, alen, glbl); | 101 | else |
102 | err = __dev_addr_add(&dev->mc_list, &dev->mc_count, addr, alen, glbl); | ||
102 | if (!err) | 103 | if (!err) |
103 | __dev_set_rx_mode(dev); | 104 | __dev_set_rx_mode(dev); |
104 | netif_addr_unlock_bh(dev); | 105 | netif_addr_unlock_bh(dev); |