usbnet: fix oops in usbnet_start_xmit
authorKonstantin Khlebnikov <khlebnikov@openvz.org>
Mon, 7 Nov 2011 05:54:58 +0000 (05:54 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 7 Nov 2011 18:25:41 +0000 (13:25 -0500)
This patch fixes the bug added in commit v3.1-rc7-1055-gf9b491e
SKB can be NULL at this point, at least for cdc-ncm.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/usbnet.c

index 7d6082160bcc42377a51ba2b8be6f60a37eec093..fae0fbd8bc887a99ca0e068bbc4d06bed884775c 100644 (file)
@@ -1057,7 +1057,8 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
        unsigned long           flags;
        int retval;
 
-       skb_tx_timestamp(skb);
+       if (skb)
+               skb_tx_timestamp(skb);
 
        // some devices want funky USB-level framing, for
        // win32 driver (usually) and/or hardware quirks