]> git.baikalelectronics.ru Git - kernel.git/commit
drivers/net/wan/hdlc_fr: Fix a double free in pvc_xmit
authorLv Yunlong <lyl2019@mail.ustc.edu.cn>
Sun, 28 Mar 2021 07:50:08 +0000 (00:50 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 29 Mar 2021 01:08:43 +0000 (18:08 -0700)
commit15eff7d75a03cf1adf4caa4d69cc5cbda7c06547
tree52ded9bf40711d25bbbbb025a939a8a0e6258212
parent6a309876a5acf9ed059941b01587f9bab6c66bd4
drivers/net/wan/hdlc_fr: Fix a double free in pvc_xmit

In pvc_xmit, if __skb_pad(skb, pad, false) failed, it will free
the skb in the first time and goto drop. But the same skb is freed
by kfree_skb(skb) in the second time in drop.

Maintaining the original function unchanged, my patch adds a new
label out to avoid the double free if __skb_pad() failed.

Fixes: 4cf330dfe471c ("drivers/net/wan/hdlc_fr: Improvements to the code of pvc_xmit")
Signed-off-by: Lv Yunlong <lyl2019@mail.ustc.edu.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wan/hdlc_fr.c