OpenVZ Forum


Home » Mailing lists » Devel » [PATCH v2] usbnet: fix oops in usbnet_start_xmit
[PATCH v2] usbnet: fix oops in usbnet_start_xmit [message #43995] Mon, 07 November 2011 14:55 Go to next message
Konstantin Khlebnikov is currently offline  Konstantin Khlebnikov
Messages: 2
Registered: November 2011
Junior Member
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>
---
drivers/net/usb/usbnet.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 7d60821..fae0fbd 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -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
Re: [PATCH v2] usbnet: fix oops in usbnet_start_xmit [message #44008 is a reply to message #43995] Mon, 07 November 2011 18:26 Go to previous message
davem is currently offline  davem
Messages: 463
Registered: February 2006
Senior Member
From: Richard Cochran <richardcochran@gmail.com>
Date: Mon, 7 Nov 2011 18:39:19 +0100

> On Mon, Nov 07, 2011 at 06:54:58PM +0300, Konstantin Khlebnikov wrote:
>> 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>

Applied, but the overall logic in the usbnet transmit path definitely
could use a good reconsideration and cleanup.

I'm even open to having generic support at the generic net device TX
level to fixup the segmentation layout of the SKB so that it meets
the device's requirements. We can do it more efficiently there too.
Previous Topic: Re: [PATCH] usbnet: fix oops in usbnet_start_xmit
Next Topic: [PATCH v4 2/3] SUNRPC: optimize net_ns dereferencing in rpcbind creation calls
Goto Forum:
  


Current Time: Wed May 08 01:05:04 GMT 2024

Total time taken to generate the page: 0.01468 seconds