diff options
author | Peter Chen <peter.chen@nxp.com> | 2016-08-11 15:51:46 +0800 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2016-08-22 10:45:12 +0300 |
commit | 80d1642d7640ef00d8823f17a529785331aceb96 (patch) | |
tree | f699672076627023088f4d6c4f490aa01a80452e /drivers/usb | |
parent | 70237dc8efd092b93b40dc2eba812d66a5d65cb1 (diff) | |
download | linux-80d1642d7640ef00d8823f17a529785331aceb96.tar.gz linux-80d1642d7640ef00d8823f17a529785331aceb96.tar.bz2 linux-80d1642d7640ef00d8823f17a529785331aceb96.zip |
usb: gadget: function: f_rndis: socket buffer may be NULL
In eth_start_xmit, the socket buffer may be NULL. So, add NULL pointer
check at .wrap API.
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/function/f_rndis.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/gadget/function/f_rndis.c b/drivers/usb/gadget/function/f_rndis.c index c8005823b190..16562e461121 100644 --- a/drivers/usb/gadget/function/f_rndis.c +++ b/drivers/usb/gadget/function/f_rndis.c @@ -374,6 +374,9 @@ static struct sk_buff *rndis_add_header(struct gether *port, { struct sk_buff *skb2; + if (!skb) + return NULL; + skb2 = skb_realloc_headroom(skb, sizeof(struct rndis_packet_msg_type)); rndis_add_hdr(skb2); |