ax25: In ax25_rebuild_header add missing kfree_skb
authorEric W. Biederman <ebiederm@xmission.com>
Mon, 2 Mar 2015 05:59:57 +0000 (23:59 -0600)
committerDavid S. Miller <davem@davemloft.net>
Mon, 2 Mar 2015 21:43:39 +0000 (16:43 -0500)
In the unlikely (impossible?) event that we attempt to transmit
an ax25 packet over a non-ax25 device free the skb so we don't
leak it.

Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-hams@vger.kernel.org
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ax25/ax25_ip.c

index 67de6b33f2c309ad4426b2075b1bd16d8ce27e11..db3c283821d1a242fcc1dff05cb6a181df1ce6ab 100644 (file)
@@ -129,6 +129,7 @@ int ax25_rebuild_header(struct sk_buff *skb)
                dev = skb->dev;
 
        if ((ax25_dev = ax25_dev_ax25dev(dev)) == NULL) {
+               kfree_skb(skb);
                goto put;
        }