Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/openwrt/mt76.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2016-01-14 03:42:17 +0300
committerFelix Fietkau <nbd@openwrt.org>2016-01-14 03:42:17 +0300
commit05511ea5881a4fcc80d6123ce27e83f76e0412ca (patch)
tree13ead9c09625abd9af6945d4a153390f6d5267a6 /util.c
parent54cb9c330ca31f55f5aa3fa6cf00bf512c21834b (diff)
mt76: remove skb_cow() to avoid unnecessary reallocations
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'util.c')
-rw-r--r--util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/util.c b/util.c
index 01fc5ab0..16d299b9 100644
--- a/util.c
+++ b/util.c
@@ -30,8 +30,8 @@ int mt76_insert_hdr_pad(struct sk_buff *skb)
if (len % 4 == 0)
return 0;
- ret = skb_cow(skb, 2);
- if (ret)
+ if (skb_headroom(skb) < 2 &&
+ (ret = pskb_expand_head(skb, 2, 0, GFP_ATOMIC)) != 0)
return ret;
skb_push(skb, 2);