Skip to contentSkip to conversation

usb: gadget: eem: fix wrong eem header operation

PATCH Superseded Linyu Yuan 2 participants 2 messages Jun 7, 2021 USB

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Linyu Yuan

author
#0 lore raw

PATCH v2 1/1 usb: gadget: eem: fix wrong eem header operation

From: Linyu Yuan <[email protected]>

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.

---
 drivers/usb/gadget/function/f_eem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/gadget/function/f_eem.c +2 -2
index cfcc4e81fb77..28dd5f1fd106 100644
@@ -495,7 +495,7 @@ static int eem_unwrap(struct gether *port,
 			skb2 = skb_clone(skb, GFP_ATOMIC);
 			if (unlikely(!skb2)) {
 				DBG(cdev, "unable to unframe EEM packet\n");
-				continue;
+				goto next;
 			}
 			skb_trim(skb2, len - ETH_FCS_LEN);
 
@@ -505,7 +505,7 @@ static int eem_unwrap(struct gether *port,
 						GFP_ATOMIC);
 			if (unlikely(!skb3)) {
 				dev_kfree_skb_any(skb2);
-				continue;
+				goto next;
 			}
 			dev_kfree_skb_any(skb2);
 			skb_queue_tail(list, skb3);
Signature · 1 line
2.25.1
#1 lore raw
Quoted 11 lines · Linyu Yuan

From: Linyu Yuan <[email protected]>

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.

---
 drivers/usb/gadget/function/f_eem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree.

You are receiving this message because of the following common error(s) as indicated below:

- This looks like a new version of a previously submitted patch, but you did not list below the --- line any changes from the previous version. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/SubmittingPatches for what needs to be done here to properly describe this.

If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers.

thanks,

greg k-h's patch email bot