diff options
Diffstat (limited to 'net/core/timestamping.c')
-rw-r--r-- | net/core/timestamping.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/core/timestamping.c b/net/core/timestamping.c index b124d28ff1c..7e7ca375d43 100644 --- a/net/core/timestamping.c +++ b/net/core/timestamping.c @@ -96,11 +96,13 @@ bool skb_defer_rx_timestamp(struct sk_buff *skb) struct phy_device *phydev; unsigned int type; - skb_push(skb, ETH_HLEN); + if (skb_headroom(skb) < ETH_HLEN) + return false; + __skb_push(skb, ETH_HLEN); type = classify(skb); - skb_pull(skb, ETH_HLEN); + __skb_pull(skb, ETH_HLEN); switch (type) { case PTP_CLASS_V1_IPV4: |