summaryrefslogtreecommitdiff
path: root/net/mac802154/wpan.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac802154/wpan.c')
-rw-r--r--net/mac802154/wpan.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/mac802154/wpan.c b/net/mac802154/wpan.c
index b61426662867..80cbee1a2f56 100644
--- a/net/mac802154/wpan.c
+++ b/net/mac802154/wpan.c
@@ -150,6 +150,9 @@ static int mac802154_header_create(struct sk_buff *skb,
skb_reset_mac_header(skb);
skb->mac_len = hlen;
+ if (hlen + len + 2 > dev->mtu)
+ return -EMSGSIZE;
+
return hlen;
}