]> git.hungrycats.org Git - linux/commitdiff
[ECONET]: Do not leak SKBs if ec_queue_packet() fails.
authorDavid S. Miller <davem@nuts.ninka.net>
Mon, 24 Nov 2003 12:00:19 +0000 (04:00 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Mon, 24 Nov 2003 12:00:19 +0000 (04:00 -0800)
Also, make sure NET_RX_DROP is returned if we did not accept the
packet.

net/econet/af_econet.c

index c81486686759b5196b44d459a42578cb785d909f..5671533fd03bf96fbf6af47e8656180a5ee440ba 100644 (file)
@@ -1041,12 +1041,15 @@ static int econet_rcv(struct sk_buff *skb, struct net_device *dev, struct packet
        if (!sk)
                goto drop;
 
-       return ec_queue_packet(sk, skb, edev->net, hdr->src_stn, hdr->cb, 
-                              hdr->port);
+       if (ec_queue_packet(sk, skb, edev->net, hdr->src_stn, hdr->cb,
+                           hdr->port))
+               goto drop;
+
+       return 0;
 
 drop:
        kfree_skb(skb);
-       return 0;
+       return NET_RX_DROP;
 }
 
 static struct packet_type econet_packet_type = {