diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-12-29 17:35:33 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-12-29 17:35:33 -0800 |
commit | 50b2abed6b0812cbeda9f6dd48cc4c247be80643 (patch) | |
tree | 43da2b779fafe2d86c63ae1db4725db84b148588 /net/packet/af_packet.c | |
parent | 7578ed02e4b08c9b7b07443b44cf0ccfdf55c91e (diff) | |
parent | aef950b4ba3196622a5bd5e21ab1d63f30658285 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
packet: fix possible dev refcnt leak when bind fail
netem: dont call vfree() under spinlock and BH disabled
netfilter: ctnetlink: fix scheduling while atomic if helper is autoloaded
netfilter: ctnetlink: fix return value of ctnetlink_get_expect()
Diffstat (limited to 'net/packet/af_packet.c')
-rw-r--r-- | net/packet/af_packet.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 3891702b81d..d9d4970b9b0 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -2448,8 +2448,12 @@ static int packet_do_bind(struct sock *sk, struct net_device *dev, __be16 protoc { struct packet_sock *po = pkt_sk(sk); - if (po->fanout) + if (po->fanout) { + if (dev) + dev_put(dev); + return -EINVAL; + } lock_sock(sk); |