Skip to content

Commit

Permalink
usb: gadget: function: f_rndis: socket buffer may be NULL
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peter Chen authored and Felipe Balbi committed Aug 22, 2016
1 parent 70237dc commit 80d1642
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/usb/gadget/function/f_rndis.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 80d1642

Please sign in to comment.