aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-12-18 13:30:50 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-12-20 14:52:17 -0500
commitf8a0a781488ec7288d1049e5d2022850aa98f7b6 (patch)
tree3acab2f7a781ce3ed83bcd5350ac14b133dc0e45 /net/mac80211
parent4cd06a344db752f513437138953af191cbe9a691 (diff)
mac80211: fix potentially redundant skb data copying
When an skb is shared, it needs to be duplicated, along with its data buffer. If the skb does not have enough headroom, using skb_copy might cause the data buffer to be copied twice (once by skb_copy and once by pskb_expand_head). Fix this by using skb_clone initially and letting ieee80211_skb_resize sort out the rest. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/tx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 90ee23550033..d2b4b67a7b53 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1934,7 +1934,7 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
1934 */ 1934 */
1935 if (skb_shared(skb)) { 1935 if (skb_shared(skb)) {
1936 tmp_skb = skb; 1936 tmp_skb = skb;
1937 skb = skb_copy(skb, GFP_ATOMIC); 1937 skb = skb_clone(skb, GFP_ATOMIC);
1938 kfree_skb(tmp_skb); 1938 kfree_skb(tmp_skb);
1939 1939
1940 if (!skb) { 1940 if (!skb) {