netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: Fix dev_mc_add()
@ 2010-03-10  5:09 Eric Dumazet
  2010-03-10 15:34 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2010-03-10  5:09 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Jiri Pirko

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>
---
diff --git a/net/core/dev_mcast.c b/net/core/dev_mcast.c
index fd91569..3dc295b 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)
 
 	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);



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: Fix dev_mc_add()
  2010-03-10  5:09 [PATCH] net: Fix dev_mc_add() Eric Dumazet
@ 2010-03-10 15:34 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-03-10 15:34 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev, jpirko

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 10 Mar 2010 06:09:08 +0100

> 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>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-10 15:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-10  5:09 [PATCH] net: Fix dev_mc_add() Eric Dumazet
2010-03-10 15:34 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).