summaryrefslogtreecommitdiff
path: root/net/packet
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-12-30 13:04:14 -0500
committerDavid S. Miller <davem@davemloft.net>2011-12-30 13:04:14 -0500
commit7f8e3234c5f7fbdb06be050c8a1907e9c36d7c61 (patch)
treed6e9edb2087fa4a97b2cc3d585a0189672a14cf4 /net/packet
parent8ade06c616b34b4237c0ed77d1ff0ce04ad7d056 (diff)
parent89307babf966165171547f105e2253dec261cfa5 (diff)
downloadlinux-3.10-7f8e3234c5f7fbdb06be050c8a1907e9c36d7c61.tar.gz
linux-3.10-7f8e3234c5f7fbdb06be050c8a1907e9c36d7c61.tar.bz2
linux-3.10-7f8e3234c5f7fbdb06be050c8a1907e9c36d7c61.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'net/packet')
-rw-r--r--net/packet/af_packet.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index e56ca75e3f4..2dbb32b988c 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -2453,8 +2453,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);