]> git.baikalelectronics.ru Git - kernel.git/commit
net: cdc_eem: fix tx fixup skb leak
authorLinyu Yuan <linyyuan@codeaurora.org>
Wed, 16 Jun 2021 23:32:32 +0000 (07:32 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Jun 2021 18:30:25 +0000 (11:30 -0700)
commitd13f9218dc97686ae61e28a7f3d852815822b7e8
treecf74e5adb2a3d2e3ef625b3b8b7c4be188789128
parent4a9e4260958002df514d9b25af7079cc9840ae25
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.

Fixes: a273582daf1c ("usbnet: CDC EEM support (v5)")
Signed-off-by: Linyu Yuan <linyyuan@codeaurora.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/cdc_eem.c