Skip to content

Commit

Permalink
net: Fix dev_mc_add()
Browse files Browse the repository at this point in the history
Commit 6e17d45 (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>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Mar 10, 2010
1 parent 0a14150 commit 3041f51
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/core/dev_mcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ int dev_mc_add(struct net_device *dev, void *addr, int alen, int glbl)

netif_addr_lock_bh(dev);
if (alen != dev->addr_len)
return -EINVAL;
err = __dev_addr_add(&dev->mc_list, &dev->mc_count, addr, alen, glbl);
err = -EINVAL;
else
err = __dev_addr_add(&dev->mc_list, &dev->mc_count, addr, alen, glbl);
if (!err)
__dev_set_rx_mode(dev);
netif_addr_unlock_bh(dev);
Expand Down

0 comments on commit 3041f51

Please sign in to comment.