net: cdc_eem: fix tx fixup skb leak
Subsystems (5)
PATCH 1/1 net: cdc_eem: fix tx fixup skb leak
when usbnet transmit a skb, eem fixup it in eem_tx_fixup(), if skb_copy_expand() failed, it return NULL, usbnet_start_xmit() will have no chance to free original skb.
fix it by free orginal skb in eem_tx_fixup() first, then check skb clone status, if failed, return NULL to usbnet.
Signed-off-by Linyu Yuan <[email protected]>
--- drivers/net/usb/cdc_eem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/usb/cdc_eem.c +1 -1
@@ -123,10 +123,10 @@ static struct sk_buff *eem_tx_fixup(struct usbnet *dev, struct sk_buff *skb, } skb2 =skb_copy_expand (skb,EEM_HEAD ,ETH_FCS_LEN + padlen, flags); +dev_kfree_skb_any (skb);if (!skb2)return NULL ; -dev_kfree_skb_any (skb); skb = skb2; done:
Signature · 1 line
2.25.1
Greg KH
maintainerQuoted 11 lines · Linyu Yuan
when usbnet transmit a skb, eem fixup it in
eem_tx_fixup(), ifskb_copy_expand()failed, it return NULL,usbnet_start_xmit()will have no chance to free original skb.fix it by free orginal skb in
eem_tx_fixup()first, then check skb clone status, if failed, return NULL to usbnet.Signed-off-by Linyu Yuan <[email protected]>--- drivers/net/usb/cdc_eem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
What commit does this "Fix:"? Can you please add that to the signed-off-by area?
thanks,
greg k-h