@@ -4099,6 +4099,14 @@ static inline void skb_ext_put(struct sk_buff *skb)
__skb_ext_put(skb->extensions);
}
+static inline void skb_ext_clear(struct sk_buff *skb)
+{
+ if (skb->active_extensions) {
+ __skb_ext_put(skb->extensions);
+ skb->active_extensions = 0;
+ }
+}
+
static inline void __skb_ext_copy(struct sk_buff *dst,
const struct sk_buff *src)
{
@@ -1470,6 +1470,7 @@ static inline void sk_wmem_free_skb(struct sock *sk, struct sk_buff *skb)
sk_mem_uncharge(sk, skb->truesize);
if (static_branch_unlikely(&tcp_tx_skb_cache_key) &&
!sk->sk_tx_skb_cache && !skb_cloned(skb)) {
+ skb_ext_clear(skb);
skb_zcopy_clear(skb, true);
sk->sk_tx_skb_cache = skb;
return;