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: f5083d0cee08a ("drivers/net/wan/hdlc_fr: Improvements to the code of pvc_xmit")
Signed-off-by: Lv Yunlong <redacted>
---
drivers/net/wan/hdlc_fr.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
Hello:
This patch was applied to netdev/net.git (refs/heads/master):
On Sun, 28 Mar 2021 00:50:08 -0700 you wrote:
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.
[...]
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: f5083d0cee08a ("drivers/net/wan/hdlc_fr: Improvements to the code of pvc_xmit")
Signed-off-by: Lv Yunlong <redacted>
---
drivers/net/wan/hdlc_fr.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
1. This patch is incorrect. "__skb_pad" will NOT free the skb on failure
when its "free_on_error" parameter is "false".
2. If you think you fix my commit, please CC me so that I can review
your patch.
I have sent another patch to revert this.