Skip to content

Commit

Permalink
Revert "drivers/net/wan/hdlc_fr: Fix a double free in pvc_xmit"
Browse files Browse the repository at this point in the history
This reverts commit 1b479fb
("drivers/net/wan/hdlc_fr: Fix a double free in pvc_xmit").

1. This commit is incorrect. "__skb_pad" will NOT free the skb on
failure when its "free_on_error" parameter is "false".

2. This commit claims to fix my commit. But it didn't CC me??

Fixes: 1b479fb ("drivers/net/wan/hdlc_fr: Fix a double free in pvc_xmit")
Cc: Lv Yunlong <[email protected]>
Signed-off-by: Xie He <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Xie He authored and davem330 committed May 3, 2021
1 parent d89ecd1 commit d362fd0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/net/wan/hdlc_fr.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ static netdev_tx_t pvc_xmit(struct sk_buff *skb, struct net_device *dev)

if (pad > 0) { /* Pad the frame with zeros */
if (__skb_pad(skb, pad, false))
goto out;
goto drop;
skb_put(skb, pad);
}
}
Expand Down Expand Up @@ -448,9 +448,8 @@ static netdev_tx_t pvc_xmit(struct sk_buff *skb, struct net_device *dev)
return NETDEV_TX_OK;

drop:
kfree_skb(skb);
out:
dev->stats.tx_dropped++;
kfree_skb(skb);
return NETDEV_TX_OK;
}

Expand Down

0 comments on commit d362fd0

Please sign in to comment.