projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
022f097
)
gianfar: fix potential sk_wmem_alloc imbalance
author
Eric Dumazet
<
[email protected]
>
Thu, 5 Jul 2012 11:45:13 +0000
(11:45 +0000)
committer
David S. Miller
<
[email protected]
>
Mon, 9 Jul 2012 22:28:03 +0000
(15:28 -0700)
commit
db83d136d7f753
(gianfar: Fix missing sock reference when
processing TX time stamps) added a potential sk_wmem_alloc imbalance
If the new skb has a different truesize than old one, we can get a
negative sk_wmem_alloc once new skb is orphaned at TX completion.
Now we no longer early orphan skbs in dev_hard_start_xmit(), this
probably can lead to fatal bugs.
Signed-off-by: Eric Dumazet <
[email protected]
>
Tested-by: Paul Gortmaker <
[email protected]
>
Cc: Manfred Rudigier <
[email protected]
>
Cc: Claudiu Manoil <
[email protected]
>
Cc: Jiajun Wu <
[email protected]
>
Cc: Andy Fleming <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
drivers/net/ethernet/freescale/gianfar.c
patch
|
blob
|
history
diff --git
a/drivers/net/ethernet/freescale/gianfar.c
b/drivers/net/ethernet/freescale/gianfar.c
index f2db8fca46a13d8b431d977df4efee8a61bc0959..ab1d80ff0791c36f937b0c06c4a52c33df340591 100644
(file)
--- a/
drivers/net/ethernet/freescale/gianfar.c
+++ b/
drivers/net/ethernet/freescale/gianfar.c
@@
-2063,10
+2063,9
@@
static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
return NETDEV_TX_OK;
}
- /* Steal sock reference for processing TX time stamps */
- swap(skb_new->sk, skb->sk);
- swap(skb_new->destructor, skb->destructor);
- kfree_skb(skb);
+ if (skb->sk)
+ skb_set_owner_w(skb_new, skb->sk);
+ consume_skb(skb);
skb = skb_new;
}