lkml.org 
[lkml]   [2019]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 2/4] wan/hdlc_x25: fix skb handling
From
From: Martin Schiller <ms@dev.tdt.de>
Date: Fri, 05 Apr 2019 08:56:44 +0200

> On 2019-04-05 02:32, David Miller wrote:
>> From: Martin Schiller <ms@dev.tdt.de>
>> Date: Wed, 3 Apr 2019 07:01:16 +0200
>>
>>> /* X.25 to LAPB */
>>> switch (skb->data[0]) {
>>> case X25_IFACE_DATA: /* Data to be transmitted */
>>> - skb_pull(skb, 1);
>>> - if ((result = lapb_data_request(dev, skb)) != LAPB_OK)
>>> - dev_kfree_skb(skb);
>>> - return NETDEV_TX_OK;
>>> + skbn = skb_copy(skb, GFP_ATOMIC);
>>> + skb_pull(skbn, 1);
>>> + skb_reset_network_header(skbn);
>>> + if ((result = lapb_data_request(dev, skbn)) != LAPB_OK)
>>> + dev_kfree_skb(skbn);
>> This leaks 'skb'.
>
> What exactly do you mean?
> 'skb' will get freed at the end of x25_xmit() function:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/wan/hdlc_x25.c#n129

Then why was it freed here in the original code?

\
 
 \ /
  Last update: 2019-04-05 21:16    [W:0.064 / U:0.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site