Commit 8c37a4ca authored by Alexander Aring's avatar Alexander Aring Committed by Greg Kroah-Hartman
Browse files

net: mac802154: tx: expand tailroom if necessary

commit f9c52831


This patch is necessary if case of AF_PACKET or other socket interface
which I am aware of it and didn't allocated the necessary room.
Reported-by: default avatarDavid Palma <>
Reported-by: default avatarRabi Narayan Sahoo <>
Signed-off-by: default avatarAlexander Aring <>
Signed-off-by: default avatarStefan Schmidt <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 6ce27549
......@@ -63,8 +63,21 @@ ieee802154_tx(struct ieee802154_local *local, struct sk_buff *skb)
int ret;
if (!(local->hw.flags & IEEE802154_HW_TX_OMIT_CKSUM)) {
u16 crc = crc_ccitt(0, skb->data, skb->len);
struct sk_buff *nskb;
u16 crc;
if (unlikely(skb_tailroom(skb) < IEEE802154_FCS_LEN)) {
nskb = skb_copy_expand(skb, 0, IEEE802154_FCS_LEN,
if (likely(nskb)) {
skb = nskb;
} else {
goto err_tx;
crc = crc_ccitt(0, skb->data, skb->len);
put_unaligned_le16(crc, skb_put(skb, 2));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment