Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 25060d8f authored by Alexander Aring's avatar Alexander Aring Committed by David S. Miller
Browse files

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: default avatarAlexander Aring <alex.aring@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fc4e98db
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -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;
}