diff options
Diffstat (limited to 'net/dccp/proto.c')
| -rw-r--r-- | net/dccp/proto.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/net/dccp/proto.c b/net/dccp/proto.c index 671cd1413d59..aa4cef374fd0 100644 --- a/net/dccp/proto.c +++ b/net/dccp/proto.c | |||
| @@ -835,6 +835,8 @@ verify_sock_status: | |||
| 835 | len = -EFAULT; | 835 | len = -EFAULT; |
| 836 | break; | 836 | break; |
| 837 | } | 837 | } |
| 838 | if (flags & MSG_TRUNC) | ||
| 839 | len = skb->len; | ||
| 838 | found_fin_ok: | 840 | found_fin_ok: |
| 839 | if (!(flags & MSG_PEEK)) | 841 | if (!(flags & MSG_PEEK)) |
| 840 | sk_eat_skb(sk, skb, 0); | 842 | sk_eat_skb(sk, skb, 0); |
| @@ -1003,12 +1005,13 @@ EXPORT_SYMBOL_GPL(dccp_shutdown); | |||
| 1003 | 1005 | ||
| 1004 | static inline int dccp_mib_init(void) | 1006 | static inline int dccp_mib_init(void) |
| 1005 | { | 1007 | { |
| 1006 | return snmp_mib_init((void**)dccp_statistics, sizeof(struct dccp_mib)); | 1008 | return snmp_mib_init((void __percpu **)dccp_statistics, |
| 1009 | sizeof(struct dccp_mib)); | ||
| 1007 | } | 1010 | } |
| 1008 | 1011 | ||
| 1009 | static inline void dccp_mib_exit(void) | 1012 | static inline void dccp_mib_exit(void) |
| 1010 | { | 1013 | { |
| 1011 | snmp_mib_free((void**)dccp_statistics); | 1014 | snmp_mib_free((void __percpu **)dccp_statistics); |
| 1012 | } | 1015 | } |
| 1013 | 1016 | ||
| 1014 | static int thash_entries; | 1017 | static int thash_entries; |
| @@ -1033,7 +1036,7 @@ static int __init dccp_init(void) | |||
| 1033 | FIELD_SIZEOF(struct sk_buff, cb)); | 1036 | FIELD_SIZEOF(struct sk_buff, cb)); |
| 1034 | rc = percpu_counter_init(&dccp_orphan_count, 0); | 1037 | rc = percpu_counter_init(&dccp_orphan_count, 0); |
| 1035 | if (rc) | 1038 | if (rc) |
| 1036 | goto out; | 1039 | goto out_fail; |
| 1037 | rc = -ENOBUFS; | 1040 | rc = -ENOBUFS; |
| 1038 | inet_hashinfo_init(&dccp_hashinfo); | 1041 | inet_hashinfo_init(&dccp_hashinfo); |
| 1039 | dccp_hashinfo.bind_bucket_cachep = | 1042 | dccp_hashinfo.bind_bucket_cachep = |
| @@ -1122,8 +1125,9 @@ static int __init dccp_init(void) | |||
| 1122 | goto out_sysctl_exit; | 1125 | goto out_sysctl_exit; |
| 1123 | 1126 | ||
| 1124 | dccp_timestamping_init(); | 1127 | dccp_timestamping_init(); |
| 1125 | out: | 1128 | |
| 1126 | return rc; | 1129 | return 0; |
| 1130 | |||
| 1127 | out_sysctl_exit: | 1131 | out_sysctl_exit: |
| 1128 | dccp_sysctl_exit(); | 1132 | dccp_sysctl_exit(); |
| 1129 | out_ackvec_exit: | 1133 | out_ackvec_exit: |
| @@ -1132,18 +1136,19 @@ out_free_dccp_mib: | |||
| 1132 | dccp_mib_exit(); | 1136 | dccp_mib_exit(); |
| 1133 | out_free_dccp_bhash: | 1137 | out_free_dccp_bhash: |
| 1134 | free_pages((unsigned long)dccp_hashinfo.bhash, bhash_order); | 1138 | free_pages((unsigned long)dccp_hashinfo.bhash, bhash_order); |
| 1135 | dccp_hashinfo.bhash = NULL; | ||
| 1136 | out_free_dccp_locks: | 1139 | out_free_dccp_locks: |
| 1137 | inet_ehash_locks_free(&dccp_hashinfo); | 1140 | inet_ehash_locks_free(&dccp_hashinfo); |
| 1138 | out_free_dccp_ehash: | 1141 | out_free_dccp_ehash: |
| 1139 | free_pages((unsigned long)dccp_hashinfo.ehash, ehash_order); | 1142 | free_pages((unsigned long)dccp_hashinfo.ehash, ehash_order); |
| 1140 | dccp_hashinfo.ehash = NULL; | ||
| 1141 | out_free_bind_bucket_cachep: | 1143 | out_free_bind_bucket_cachep: |
| 1142 | kmem_cache_destroy(dccp_hashinfo.bind_bucket_cachep); | 1144 | kmem_cache_destroy(dccp_hashinfo.bind_bucket_cachep); |
| 1143 | dccp_hashinfo.bind_bucket_cachep = NULL; | ||
| 1144 | out_free_percpu: | 1145 | out_free_percpu: |
| 1145 | percpu_counter_destroy(&dccp_orphan_count); | 1146 | percpu_counter_destroy(&dccp_orphan_count); |
| 1146 | goto out; | 1147 | out_fail: |
| 1148 | dccp_hashinfo.bhash = NULL; | ||
| 1149 | dccp_hashinfo.ehash = NULL; | ||
| 1150 | dccp_hashinfo.bind_bucket_cachep = NULL; | ||
| 1151 | return rc; | ||
| 1147 | } | 1152 | } |
| 1148 | 1153 | ||
| 1149 | static void __exit dccp_fini(void) | 1154 | static void __exit dccp_fini(void) |
