diff options
-rw-r--r-- | drivers/net/forcedeth.c | 13 | ||||
-rw-r--r-- | include/linux/skbuff.h | 9 | ||||
-rw-r--r-- | include/net/sock.h | 1 | ||||
-rw-r--r-- | net/core/skbuff.c | 8 | ||||
-rw-r--r-- | net/core/sock.c | 1 |
5 files changed, 12 insertions, 20 deletions
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 5b910cf63740..b8251e827059 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -6011,9 +6011,20 @@ static void nv_shutdown(struct pci_dev *pdev) | |||
6011 | if (netif_running(dev)) | 6011 | if (netif_running(dev)) |
6012 | nv_close(dev); | 6012 | nv_close(dev); |
6013 | 6013 | ||
6014 | nv_restore_mac_addr(pdev); | 6014 | /* |
6015 | * Restore the MAC so a kernel started by kexec won't get confused. | ||
6016 | * If we really go for poweroff, we must not restore the MAC, | ||
6017 | * otherwise the MAC for WOL will be reversed at least on some boards. | ||
6018 | */ | ||
6019 | if (system_state != SYSTEM_POWER_OFF) { | ||
6020 | nv_restore_mac_addr(pdev); | ||
6021 | } | ||
6015 | 6022 | ||
6016 | pci_disable_device(pdev); | 6023 | pci_disable_device(pdev); |
6024 | /* | ||
6025 | * Apparently it is not possible to reinitialise from D3 hot, | ||
6026 | * only put the device into D3 if we really go for poweroff. | ||
6027 | */ | ||
6017 | if (system_state == SYSTEM_POWER_OFF) { | 6028 | if (system_state == SYSTEM_POWER_OFF) { |
6018 | if (pci_enable_wake(pdev, PCI_D3cold, np->wolenabled)) | 6029 | if (pci_enable_wake(pdev, PCI_D3cold, np->wolenabled)) |
6019 | pci_enable_wake(pdev, PCI_D3hot, np->wolenabled); | 6030 | pci_enable_wake(pdev, PCI_D3hot, np->wolenabled); |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index cf2cb50f77d1..9dcf956ad18a 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -416,15 +416,6 @@ extern void skb_over_panic(struct sk_buff *skb, int len, | |||
416 | void *here); | 416 | void *here); |
417 | extern void skb_under_panic(struct sk_buff *skb, int len, | 417 | extern void skb_under_panic(struct sk_buff *skb, int len, |
418 | void *here); | 418 | void *here); |
419 | extern void skb_truesize_bug(struct sk_buff *skb); | ||
420 | |||
421 | static inline void skb_truesize_check(struct sk_buff *skb) | ||
422 | { | ||
423 | int len = sizeof(struct sk_buff) + skb->len; | ||
424 | |||
425 | if (unlikely((int)skb->truesize < len)) | ||
426 | skb_truesize_bug(skb); | ||
427 | } | ||
428 | 419 | ||
429 | extern int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb, | 420 | extern int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb, |
430 | int getfrag(void *from, char *to, int offset, | 421 | int getfrag(void *from, char *to, int offset, |
diff --git a/include/net/sock.h b/include/net/sock.h index ce3b5b622683..eefeeaf7fc46 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -860,7 +860,6 @@ static inline void sk_mem_uncharge(struct sock *sk, int size) | |||
860 | 860 | ||
861 | static inline void sk_wmem_free_skb(struct sock *sk, struct sk_buff *skb) | 861 | static inline void sk_wmem_free_skb(struct sock *sk, struct sk_buff *skb) |
862 | { | 862 | { |
863 | skb_truesize_check(skb); | ||
864 | sock_set_flag(sk, SOCK_QUEUE_SHRUNK); | 863 | sock_set_flag(sk, SOCK_QUEUE_SHRUNK); |
865 | sk->sk_wmem_queued -= skb->truesize; | 864 | sk->sk_wmem_queued -= skb->truesize; |
866 | sk_mem_uncharge(sk, skb->truesize); | 865 | sk_mem_uncharge(sk, skb->truesize); |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index da74b844f4ea..c6a6b166f8d6 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -143,14 +143,6 @@ void skb_under_panic(struct sk_buff *skb, int sz, void *here) | |||
143 | BUG(); | 143 | BUG(); |
144 | } | 144 | } |
145 | 145 | ||
146 | void skb_truesize_bug(struct sk_buff *skb) | ||
147 | { | ||
148 | WARN(net_ratelimit(), KERN_ERR "SKB BUG: Invalid truesize (%u) " | ||
149 | "len=%u, sizeof(sk_buff)=%Zd\n", | ||
150 | skb->truesize, skb->len, sizeof(struct sk_buff)); | ||
151 | } | ||
152 | EXPORT_SYMBOL(skb_truesize_bug); | ||
153 | |||
154 | /* Allocate a new skbuff. We do this ourselves so we can fill in a few | 146 | /* Allocate a new skbuff. We do this ourselves so we can fill in a few |
155 | * 'private' fields and also do memory statistics to find all the | 147 | * 'private' fields and also do memory statistics to find all the |
156 | * [BEEP] leaks. | 148 | * [BEEP] leaks. |
diff --git a/net/core/sock.c b/net/core/sock.c index 6f2e1337975d..6e4f14d1ef81 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -1137,7 +1137,6 @@ void sock_rfree(struct sk_buff *skb) | |||
1137 | { | 1137 | { |
1138 | struct sock *sk = skb->sk; | 1138 | struct sock *sk = skb->sk; |
1139 | 1139 | ||
1140 | skb_truesize_check(skb); | ||
1141 | atomic_sub(skb->truesize, &sk->sk_rmem_alloc); | 1140 | atomic_sub(skb->truesize, &sk->sk_rmem_alloc); |
1142 | sk_mem_uncharge(skb->sk, skb->truesize); | 1141 | sk_mem_uncharge(skb->sk, skb->truesize); |
1143 | } | 1142 | } |