Skip to content

Commit 305f670

Browse files
Linyu Yuangregkh
authored andcommitted
usb: gadget: eem: fix wrong eem header operation
when skb_clone() or skb_copy_expand() fail, it should pull skb with lengh indicated by header, or not it will read network data and check it as header. Cc: <[email protected]> Signed-off-by: Linyu Yuan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 184fa76 commit 305f670

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/usb/gadget/function/f_eem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ static int eem_unwrap(struct gether *port,
495495
skb2 = skb_clone(skb, GFP_ATOMIC);
496496
if (unlikely(!skb2)) {
497497
DBG(cdev, "unable to unframe EEM packet\n");
498-
continue;
498+
goto next;
499499
}
500500
skb_trim(skb2, len - ETH_FCS_LEN);
501501

@@ -505,7 +505,7 @@ static int eem_unwrap(struct gether *port,
505505
GFP_ATOMIC);
506506
if (unlikely(!skb3)) {
507507
dev_kfree_skb_any(skb2);
508-
continue;
508+
goto next;
509509
}
510510
dev_kfree_skb_any(skb2);
511511
skb_queue_tail(list, skb3);

0 commit comments

Comments
 (0)