netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] packet: add an unlock on error in fanout_add()
@ 2011-07-08  7:28 Dan Carpenter
  2011-07-08  8:01 ` Eric Dumazet
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2011-07-08  7:28 UTC (permalink / raw)
  To: David S. Miller
  Cc: Eric Dumazet, Changli Gao, Ben Greear, Neil Horman,
	open list:NETWORKING [GENERAL], kernel-janitors

We need to release the "fanout_mutex" here.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index aec50a1..3cbe950 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -589,8 +589,10 @@ static int fanout_add(struct sock *sk, u16 id, u16 type_flags)
 			break;
 		}
 	}
-	if (match && match->defrag != defrag)
-		return -EINVAL;
+	if (match && match->defrag != defrag) {
+		err = -EINVAL;
+		goto out_unlock;
+	}
 	if (!match) {
 		match = kzalloc(sizeof(*match), GFP_KERNEL);
 		if (match) {
@@ -626,6 +628,8 @@ static int fanout_add(struct sock *sk, u16 id, u16 type_flags)
 			}
 		}
 	}
+
+out_unlock:
 	mutex_unlock(&fanout_mutex);
 	return err;
 }

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

* Re: [patch] packet: add an unlock on error in fanout_add()
  2011-07-08  7:28 [patch] packet: add an unlock on error in fanout_add() Dan Carpenter
@ 2011-07-08  8:01 ` Eric Dumazet
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Dumazet @ 2011-07-08  8:01 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: David S. Miller, Changli Gao, Ben Greear, Neil Horman,
	open list:NETWORKING [GENERAL], kernel-janitors

Le vendredi 08 juillet 2011 à 10:28 +0300, Dan Carpenter a écrit :
> We need to release the "fanout_mutex" here.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 

Thanks, was fixed yesterday :

http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=commit;h=afe62c68cd3562c5f8e3ea293e82906dd5a87936




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

end of thread, other threads:[~2011-07-08  8:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-08  7:28 [patch] packet: add an unlock on error in fanout_add() Dan Carpenter
2011-07-08  8:01 ` Eric Dumazet

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