RE: [PATCH net v2 2/2] net: dsa: skb_put_padto() already frees nskb

2017-08-23 Thread Woojung.Huh
> The first call of skb_put_padto() will free up the SKB on error, but we > return NULL which tells dsa_slave_xmit() that the original SKB should be > freed so this would lead to a double free here. > > The second skb_put_padto() already frees the passed sk_buff reference > upon error, so calling

[PATCH net v2 2/2] net: dsa: skb_put_padto() already frees nskb

2017-08-22 Thread Florian Fainelli
The first call of skb_put_padto() will free up the SKB on error, but we return NULL which tells dsa_slave_xmit() that the original SKB should be freed so this would lead to a double free here. The second skb_put_padto() already frees the passed sk_buff reference upon error, so calling kfree_skb()