aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2013-02-05 10:23:44 +0000
committerDavid S. Miller <davem@davemloft.net>2013-02-06 15:56:17 -0500
commit25060d8f3f2c21daadb4fc1fb0e37ce2c992e30b (patch)
treea8736abdc3e79d9dc1f66ba0906109851a61f69b /net
parent6lowpan: use stack buffer instead of heap (diff)
downloadlinux-dev-25060d8f3f2c21daadb4fc1fb0e37ce2c992e30b.tar.xz
linux-dev-25060d8f3f2c21daadb4fc1fb0e37ce2c992e30b.zip
wpan: use stack buffer instead of heap
head buffer is only temporary available in mac802154_header_create. So it's not necessary to put it on the heap. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/mac802154/wpan.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/net/mac802154/wpan.c b/net/mac802154/wpan.c
index 98c867bca986..d20c6d3c247d 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;
}