summaryrefslogtreecommitdiff
path: root/include/net/mac802154.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-03-03 21:27:23 (GMT)
committerDavid S. Miller <davem@davemloft.net>2016-03-03 21:27:23 (GMT)
commitaefd3fb26ed28ee21ad658b3f326cd090c111eb3 (patch)
treea1f8477105a1cbaea4b1c32e250c7140c9ec8973 /include/net/mac802154.h
parent5eb4dce3b3471ec9d1ea2945fa3d2bab4ac7e100 (diff)
parent34bf1912bfc06bd9200893916078eb0f16480a95 (diff)
downloadlinux-aefd3fb26ed28ee21ad658b3f326cd090c111eb3.tar.xz
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next
Johan Hedberg says: ==================== pull request: bluetooth-next 2016-03-01 Here's our main set of Bluetooth & 802.15.4 patches for the 4.6 kernel. - New Bluetooth HCI driver for Intel/AG6xx controllers - New Broadcom ACPI IDs - LED trigger support for indicating Bluetooth powered state - Various fixes in mac802154, 6lowpan and related drivers - New USB IDs for AR3012 Bluetooth controllers Please let me know if there are any issues pulling. Thanks. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/mac802154.h')
-rw-r--r--include/net/mac802154.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/net/mac802154.h b/include/net/mac802154.h
index da574bb..2e3cdd20 100644
--- a/include/net/mac802154.h
+++ b/include/net/mac802154.h
@@ -247,8 +247,9 @@ struct ieee802154_ops {
*/
static inline __le16 ieee802154_get_fc_from_skb(const struct sk_buff *skb)
{
- /* return some invalid fc on failure */
- if (unlikely(skb->len < 2)) {
+ /* check if we can fc at skb_mac_header of sk buffer */
+ if (unlikely(!skb_mac_header_was_set(skb) ||
+ (skb_tail_pointer(skb) - skb_mac_header(skb)) < 2)) {
WARN_ON(1);
return cpu_to_le16(0);
}