More cases to use ieee80211_skb_copy_noderef

git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3262 0192ed92-7a03-0410-a25b-9323aeb14dbd
This commit is contained in:
mentor 2008-01-26 17:46:36 +00:00
parent 776a840f28
commit 0b74c2ebe0
3 changed files with 14 additions and 29 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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;