diff options
Diffstat (limited to 'drivers/net/wimax/i2400m/netdev.c')
-rw-r--r-- | drivers/net/wimax/i2400m/netdev.c | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/drivers/net/wimax/i2400m/netdev.c b/drivers/net/wimax/i2400m/netdev.c index 64a110604ad..63e4b709efa 100644 --- a/drivers/net/wimax/i2400m/netdev.c +++ b/drivers/net/wimax/i2400m/netdev.c | |||
@@ -367,38 +367,28 @@ netdev_tx_t i2400m_hard_start_xmit(struct sk_buff *skb, | |||
367 | { | 367 | { |
368 | struct i2400m *i2400m = net_dev_to_i2400m(net_dev); | 368 | struct i2400m *i2400m = net_dev_to_i2400m(net_dev); |
369 | struct device *dev = i2400m_dev(i2400m); | 369 | struct device *dev = i2400m_dev(i2400m); |
370 | int result; | 370 | int result = -1; |
371 | 371 | ||
372 | d_fnstart(3, dev, "(skb %p net_dev %p)\n", skb, net_dev); | 372 | d_fnstart(3, dev, "(skb %p net_dev %p)\n", skb, net_dev); |
373 | if (skb_header_cloned(skb)) { | 373 | |
374 | /* | 374 | if (skb_header_cloned(skb) && |
375 | * Make tcpdump/wireshark happy -- if they are | 375 | pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) |
376 | * running, the skb is cloned and we will overwrite | 376 | goto drop; |
377 | * the mac fields in i2400m_tx_prep_header. Expand | ||
378 | * seems to fix this... | ||
379 | */ | ||
380 | result = pskb_expand_head(skb, 0, 0, GFP_ATOMIC); | ||
381 | if (result) { | ||
382 | result = NETDEV_TX_BUSY; | ||
383 | goto error_expand; | ||
384 | } | ||
385 | } | ||
386 | 377 | ||
387 | if (i2400m->state == I2400M_SS_IDLE) | 378 | if (i2400m->state == I2400M_SS_IDLE) |
388 | result = i2400m_net_wake_tx(i2400m, net_dev, skb); | 379 | result = i2400m_net_wake_tx(i2400m, net_dev, skb); |
389 | else | 380 | else |
390 | result = i2400m_net_tx(i2400m, net_dev, skb); | 381 | result = i2400m_net_tx(i2400m, net_dev, skb); |
391 | if (result < 0) | 382 | if (result < 0) { |
383 | drop: | ||
392 | net_dev->stats.tx_dropped++; | 384 | net_dev->stats.tx_dropped++; |
393 | else { | 385 | } else { |
394 | net_dev->stats.tx_packets++; | 386 | net_dev->stats.tx_packets++; |
395 | net_dev->stats.tx_bytes += skb->len; | 387 | net_dev->stats.tx_bytes += skb->len; |
396 | } | 388 | } |
397 | result = NETDEV_TX_OK; | 389 | dev_kfree_skb(skb); |
398 | error_expand: | ||
399 | kfree_skb(skb); | ||
400 | d_fnend(3, dev, "(skb %p net_dev %p) = %d\n", skb, net_dev, result); | 390 | d_fnend(3, dev, "(skb %p net_dev %p) = %d\n", skb, net_dev, result); |
401 | return result; | 391 | return NETDEV_TX_OK; |
402 | } | 392 | } |
403 | 393 | ||
404 | 394 | ||