diff --git a/ath/if_ath.c b/ath/if_ath.c index ae60a88..8a7bac1 100644 --- a/ath/if_ath.c +++ b/ath/if_ath.c @@ -3123,8 +3123,7 @@ ath_hardstart(struct sk_buff *skb, struct net_device *dev) requeue = 1; goto hardstart_fail; } - /* If the clone works, bump the reference count for our copy. */ - SKB_CB(skb)->ni = ieee80211_ref_node(SKB_CB(skb_orig)->ni); + ieee80211_skb_copy_noderef(skb_orig, skb); ieee80211_dev_kfree_skb(&skb_orig); } else { if (SKB_CB(skb)->ni != NULL) @@ -6006,10 +6005,7 @@ ath_skb_removepad(struct sk_buff *skb, unsigned int copy_skb) tskb = skb_copy(skb, GFP_ATOMIC); if (tskb == NULL) return NULL; - /* Reference any node from the source skb. */ - if (SKB_CB(skb)->ni != NULL) - SKB_CB(tskb)->ni = ieee80211_ref_node( - SKB_CB(skb)->ni); + ieee80211_skb_copy_noderef(skb, tskb); } memmove(tskb->data + padbytes, tskb->data, headersize); skb_pull(tskb, padbytes); diff --git a/net80211/ieee80211_monitor.c b/net80211/ieee80211_monitor.c index 4926b63..ff52576 100644 --- a/net80211/ieee80211_monitor.c +++ b/net80211/ieee80211_monitor.c @@ -387,10 +387,8 @@ ieee80211_input_monitor(struct ieee80211com *ic, struct sk_buff *skb, /* XXX stat+msg */ continue; } - /* We duplicate the reference after skb_copy */ - if (SKB_CB(skb)->ni != NULL) { - SKB_CB(skb1)->ni = ieee80211_ref_node(SKB_CB(skb)->ni); - } + ieee80211_skb_copy_noderef(skb, skb1); + if (vap->iv_monitor_txf_len && tx) { /* truncate transmit feedback packets */ skb_trim(skb1, vap->iv_monitor_txf_len); diff --git a/net80211/ieee80211_output.c b/net80211/ieee80211_output.c index cc7726f..5cbdf2b 100644 --- a/net80211/ieee80211_output.c +++ b/net80211/ieee80211_output.c @@ -631,11 +631,6 @@ ieee80211_skbhdr_adjust(struct ieee80211vap *vap, int hdrsize, if (skb_headroom(skb) < need_headroom) { struct sk_buff *tmp = skb; skb = skb_realloc_headroom(skb, need_headroom); - /* Increment reference count after copy */ - if (NULL != skb && SKB_CB(tmp)->ni != NULL) { - SKB_CB(skb)->ni = ieee80211_ref_node(SKB_CB(tmp)->ni); - } - ieee80211_dev_kfree_skb(&tmp); if (skb == NULL) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT, "%s: cannot expand storage (head1)\n", @@ -643,10 +638,11 @@ ieee80211_skbhdr_adjust(struct ieee80211vap *vap, int hdrsize, vap->iv_stats.is_tx_nobuf++; ieee80211_dev_kfree_skb(&skb2); return NULL; - } + } else + ieee80211_skb_copy_noderef(tmp, skb); + ieee80211_dev_kfree_skb(&tmp); /* NB: cb[] area was copied, but not next ptr. must do that - * prior to return on success. - */ + * prior to return on success. */ } /* second skb with header and tail adjustments possible */ @@ -668,11 +664,6 @@ ieee80211_skbhdr_adjust(struct ieee80211vap *vap, int hdrsize, struct sk_buff *tmp = skb2; skb2 = skb_realloc_headroom(skb2, inter_headroom); - /* Increment reference count after copy */ - if (NULL != skb2 && SKB_CB(tmp)->ni != NULL) { - SKB_CB(skb2)->ni = ieee80211_ref_node(SKB_CB(tmp)->ni); - } - ieee80211_dev_kfree_skb(&tmp); if (skb2 == NULL) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT, "%s: cannot expand storage (head2)\n", @@ -681,7 +672,9 @@ ieee80211_skbhdr_adjust(struct ieee80211vap *vap, int hdrsize, /* this shouldn't happen, but don't send first ff either */ ieee80211_dev_kfree_skb(&skb); skb = NULL; - } + } else + ieee80211_skb_copy_noderef(tmp, skb); + ieee80211_dev_kfree_skb(&tmp); } if (skb) { skb->next = skb2; @@ -708,15 +701,13 @@ ieee80211_skbhdr_adjust(struct ieee80211vap *vap, int hdrsize, struct sk_buff *tmp = skb; skb = skb_realloc_headroom(skb, need_headroom); /* Increment reference count after copy */ - if (NULL != skb && SKB_CB(tmp)->ni != NULL) { - SKB_CB(skb)->ni = ieee80211_ref_node(SKB_CB(tmp)->ni); - } - ieee80211_dev_kfree_skb(&tmp); if (skb == NULL) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT, "%s: cannot expand storage (head)\n", __func__); vap->iv_stats.is_tx_nobuf++; - } + } else + ieee80211_skb_copy_noderef(tmp, skb); + ieee80211_dev_kfree_skb(&tmp); } return skb;