[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1360088403.28557.6.camel@edumazet-glaptop>
Date: Tue, 05 Feb 2013 10:20:03 -0800
From: Eric Dumazet <eric.dumazet@...il.com>
To: Alexander Aring <alex.aring@...il.com>
Cc: alex.bluesman.smirnov@...il.com, dbaryshkov@...il.com,
linux-zigbee-devel@...ts.sourceforge.net, davem@...emloft.net,
netdev@...r.kernel.org
Subject: Re: [PATCH] wpan: use GFP_ATOMIC instead of GFP_KERNEL
On Tue, 2013-02-05 at 19:00 +0100, Alexander Aring wrote:
> I don't know how I can do that. head is a temp buffer.
> At the end of this function stands:
>
> memcpy(skb_push(skb, pos), head, pos)
>
> and 'pos' is determined at runtime. skb_push will add data to the
> start of buffer, so head buffer will be at the start of skb. I don't
> know where I should manipulate the skb buffer at beginning of this function.
Please try :
diff --git a/net/mac802154/wpan.c b/net/mac802154/wpan.c
index 199b922..d18f2ac 100644
--- a/net/mac802154/wpan.c
+++ b/net/mac802154/wpan.c
@@ -137,16 +137,12 @@ static int mac802154_header_create(struct sk_buff *skb,
struct ieee802154_addr dev_addr;
struct mac802154_sub_if_data *priv = netdev_priv(dev);
int pos = 2;
- u8 *head;
+ u8 head[MAC802154_FRAME_HARD_HEADER_LEN];
u16 fc;
if (!daddr)
return -EINVAL;
- head = kzalloc(MAC802154_FRAME_HARD_HEADER_LEN, GFP_KERNEL);
- if (head == NULL)
- return -ENOMEM;
-
head[pos++] = mac_cb(skb)->seq; /* DSN/BSN */
fc = mac_cb_type(skb);
@@ -210,7 +206,6 @@ static int mac802154_header_create(struct sk_buff *skb,
head[1] = fc >> 8;
memcpy(skb_push(skb, pos), head, pos);
- kfree(head);
return pos;
}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists