summaryrefslogtreecommitdiff
path: root/drivers/staging/gdm724x
diff options
context:
space:
mode:
authorAndrii Vladyka <tulup@mail.ru>2017-10-18 16:23:44 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-20 14:42:50 +0200
commitd67dc3a40278569c2c6f0e6acddf0bfe06af9e6a (patch)
tree30be41ea6ebeb8eac2db237aa2eca1fa6a2d8075 /drivers/staging/gdm724x
parent3de1abef24a221880614e387e150c1fc7004bc23 (diff)
staging: gdm724x: check for skb->len in gdm_lte_emulate_arp
check for skb->len in gdm_lte_emulate_arp in gdm724x driver Signed-off-by: Andrii Vladyka <tulup@mail.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/gdm724x')
-rw-r--r--drivers/staging/gdm724x/gdm_lte.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/staging/gdm724x/gdm_lte.c b/drivers/staging/gdm724x/gdm_lte.c
index 9ab6ce231f11..066b14ecc366 100644
--- a/drivers/staging/gdm724x/gdm_lte.c
+++ b/drivers/staging/gdm724x/gdm_lte.c
@@ -26,6 +26,7 @@
#include <linux/icmp.h>
#include <linux/icmpv6.h>
#include <linux/uaccess.h>
+#include <linux/errno.h>
#include <net/ndisc.h>
#include "gdm_lte.h"
@@ -118,6 +119,10 @@ static int gdm_lte_emulate_arp(struct sk_buff *skb_in, u32 nic_type)
void *mac_header_data;
u32 mac_header_len;
+ /* Check for skb->len, discard if empty */
+ if (skb_in->len == 0)
+ return -ENODATA;
+
/* Format the mac header so that it can be put to skb */
if (ntohs(((struct ethhdr *)skb_in->data)->h_proto) == ETH_P_8021Q) {
memcpy(&vlan_eth, skb_in->data, sizeof(struct vlan_ethhdr));