Commit d82aa8ae authored by Nathan Sullivan's avatar Nathan Sullivan Committed by Felipe Balbi

usb: gadget: fix eem_wrap cloned skb logic

Even if the skb is cloned, we still need a ZLP or USB will stall.
Signed-off-by: default avatarNathan Sullivan <nathan.sullivan@ni.com>
Acked-by: default avatarBrad Mouring <brad.mouring@ni.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 029d97ff
......@@ -355,7 +355,6 @@ static struct sk_buff *eem_wrap(struct gether *port, struct sk_buff *skb)
int padlen = 0;
u16 len = skb->len;
if (!skb_cloned(skb)) {
int headroom = skb_headroom(skb);
int tailroom = skb_tailroom(skb);
......@@ -366,9 +365,8 @@ static struct sk_buff *eem_wrap(struct gether *port, struct sk_buff *skb)
padlen += 2;
if ((tailroom >= (ETH_FCS_LEN + padlen)) &&
(headroom >= EEM_HLEN))
(headroom >= EEM_HLEN) && !skb_cloned(skb))
goto done;
}
skb2 = skb_copy_expand(skb, EEM_HLEN, ETH_FCS_LEN + padlen, GFP_ATOMIC);
dev_kfree_skb_any(skb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment