Skip to content

Commit 3ff488a

Browse files
Colin Ian KingFelipe Balbi
authored andcommitted
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: 70237dc ("usb: gadget: function: f_eem: socket buffer may be NULL") Acked-by: Peter Chen <[email protected]> Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
1 parent 519d8bd commit 3ff488a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/gadget/function/f_eem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ static struct sk_buff *eem_wrap(struct gether *port, struct sk_buff *skb)
342342
struct sk_buff *skb2 = NULL;
343343
struct usb_ep *in = port->in_ep;
344344
int headroom, tailroom, padlen = 0;
345-
u16 len = skb->len;
345+
u16 len;
346346

347347
if (!skb)
348348
return NULL;

0 commit comments

Comments
 (0)