Commit 72eb3cb0 authored by David S. Miller's avatar David S. Miller Committed by Linus Torvalds

[ECONET]: Do not leak SKBs if ec_queue_packet() fails.

Also, make sure NET_RX_DROP is returned if we did not accept the
packet.
parent d2d7f4b4
...@@ -1041,12 +1041,15 @@ static int econet_rcv(struct sk_buff *skb, struct net_device *dev, struct packet ...@@ -1041,12 +1041,15 @@ static int econet_rcv(struct sk_buff *skb, struct net_device *dev, struct packet
if (!sk) if (!sk)
goto drop; goto drop;
return ec_queue_packet(sk, skb, edev->net, hdr->src_stn, hdr->cb, if (ec_queue_packet(sk, skb, edev->net, hdr->src_stn, hdr->cb,
hdr->port); hdr->port))
goto drop;
return 0;
drop: drop:
kfree_skb(skb); kfree_skb(skb);
return 0; return NET_RX_DROP;
} }
static struct packet_type econet_packet_type = { static struct packet_type econet_packet_type = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment