diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00usb.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00usb.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c index ab4797ed94c9..568d73847dca 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/rt2x00/rt2x00usb.c | |||
@@ -245,13 +245,20 @@ static void rt2x00usb_interrupt_rxdone(struct urb *urb) | |||
245 | * Allocate a new sk buffer to replace the current one. | 245 | * Allocate a new sk buffer to replace the current one. |
246 | * If allocation fails, we should drop the current frame | 246 | * If allocation fails, we should drop the current frame |
247 | * so we can recycle the existing sk buffer for the new frame. | 247 | * so we can recycle the existing sk buffer for the new frame. |
248 | * As alignment we use 2 and not NET_IP_ALIGN because we need | ||
249 | * to be sure we have 2 bytes room in the head. (NET_IP_ALIGN | ||
250 | * can be 0 on some hardware). We use these 2 bytes for frame | ||
251 | * alignment later, we assume that the chance that | ||
252 | * header_size % 4 == 2 is bigger then header_size % 2 == 0 | ||
253 | * and thus optimize alignment by reserving the 2 bytes in | ||
254 | * advance. | ||
248 | */ | 255 | */ |
249 | frame_size = entry->ring->data_size + entry->ring->desc_size; | 256 | frame_size = entry->ring->data_size + entry->ring->desc_size; |
250 | skb = dev_alloc_skb(frame_size + NET_IP_ALIGN); | 257 | skb = dev_alloc_skb(frame_size + 2); |
251 | if (!skb) | 258 | if (!skb) |
252 | goto skip_entry; | 259 | goto skip_entry; |
253 | 260 | ||
254 | skb_reserve(skb, NET_IP_ALIGN); | 261 | skb_reserve(skb, 2); |
255 | skb_put(skb, frame_size); | 262 | skb_put(skb, frame_size); |
256 | 263 | ||
257 | /* | 264 | /* |