Skip to content

Commit d362fd0

Browse files
Xie Hedavem330
authored andcommitted
Revert "drivers/net/wan/hdlc_fr: Fix a double free in pvc_xmit"
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]>
1 parent d89ecd1 commit d362fd0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/net/wan/hdlc_fr.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ static netdev_tx_t pvc_xmit(struct sk_buff *skb, struct net_device *dev)
415415

416416
if (pad > 0) { /* Pad the frame with zeros */
417417
if (__skb_pad(skb, pad, false))
418-
goto out;
418+
goto drop;
419419
skb_put(skb, pad);
420420
}
421421
}
@@ -448,9 +448,8 @@ static netdev_tx_t pvc_xmit(struct sk_buff *skb, struct net_device *dev)
448448
return NETDEV_TX_OK;
449449

450450
drop:
451-
kfree_skb(skb);
452-
out:
453451
dev->stats.tx_dropped++;
452+
kfree_skb(skb);
454453
return NETDEV_TX_OK;
455454
}
456455

0 commit comments

Comments
 (0)