]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: prevent potenial null pointer dereference on skb->len
authorColin Ian King <colin.king@canonical.com>
Mon, 5 Sep 2016 15:37:12 +0000 (16:37 +0100)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Tue, 6 Sep 2016 07:44:03 +0000 (10:44 +0300)
commit592d7593f1300f08ec3054b69f936b54277fd2b5
treeb1f635defa3e4459fb5ff7045c92c6cb7e013acf
parent32d95992f870c3893c7fc62a3ae5b573e5b6ebff
usb: gadget: prevent potenial null pointer dereference on skb->len

An earlier fix partially fixed the null pointer dereference on skb->len
by moving the assignment of len after the check on skb being non-null,
however it failed to remove the erroneous dereference when assigning len.
Correctly fix this by removing the initialisation of len as was
originally intended.

Fixes: a8767aaab7483f ("usb: gadget: function: f_eem: socket buffer may be NULL")
Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/gadget/function/f_eem.c