diff options
Diffstat (limited to 'net/packet')
-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 e56ca75e3f43..2dbb32b988c4 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 | |||
2453 | { | 2453 | { |
2454 | struct packet_sock *po = pkt_sk(sk); | 2454 | struct packet_sock *po = pkt_sk(sk); |
2455 | 2455 | ||
2456 | if (po->fanout) | 2456 | if (po->fanout) { |
2457 | if (dev) | ||
2458 | dev_put(dev); | ||
2459 | |||
2457 | return -EINVAL; | 2460 | return -EINVAL; |
2461 | } | ||
2458 | 2462 | ||
2459 | lock_sock(sk); | 2463 | lock_sock(sk); |
2460 | 2464 | ||