Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: change proto destroy method to return void

Change struct proto destroy function pointer to return void. Noticed
by Al Viro.

Signed-off-by: Brian Haley <brian.haley@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Brian Haley and committed by
David S. Miller
7d06b2e0 4ae127d1

+19 -30
+1 -1
include/net/sock.h
··· 524 524 int (*ioctl)(struct sock *sk, int cmd, 525 525 unsigned long arg); 526 526 int (*init)(struct sock *sk); 527 - int (*destroy)(struct sock *sk); 527 + void (*destroy)(struct sock *sk); 528 528 void (*shutdown)(struct sock *sk, int how); 529 529 int (*setsockopt)(struct sock *sk, int level, 530 530 int optname, char __user *optval,
+1 -1
include/net/tcp.h
··· 1366 1366 extern struct request_sock_ops tcp_request_sock_ops; 1367 1367 extern struct request_sock_ops tcp6_request_sock_ops; 1368 1368 1369 - extern int tcp_v4_destroy_sock(struct sock *sk); 1369 + extern void tcp_v4_destroy_sock(struct sock *sk); 1370 1370 1371 1371 extern int tcp_v4_gso_send_check(struct sk_buff *skb); 1372 1372 extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features);
+1 -1
include/net/transp_v6.h
··· 53 53 */ 54 54 extern struct inet_connection_sock_af_ops ipv4_specific; 55 55 56 - extern int inet6_destroy_sock(struct sock *sk); 56 + extern void inet6_destroy_sock(struct sock *sk); 57 57 58 58 #endif 59 59
+1 -1
net/dccp/dccp.h
··· 262 262 const struct dccp_hdr *dh, const unsigned len); 263 263 264 264 extern int dccp_init_sock(struct sock *sk, const __u8 ctl_sock_initialized); 265 - extern int dccp_destroy_sock(struct sock *sk); 265 + extern void dccp_destroy_sock(struct sock *sk); 266 266 267 267 extern void dccp_close(struct sock *sk, long timeout); 268 268 extern struct sk_buff *dccp_make_response(struct sock *sk,
+2 -2
net/dccp/ipv6.c
··· 1091 1091 return err; 1092 1092 } 1093 1093 1094 - static int dccp_v6_destroy_sock(struct sock *sk) 1094 + static void dccp_v6_destroy_sock(struct sock *sk) 1095 1095 { 1096 1096 dccp_destroy_sock(sk); 1097 - return inet6_destroy_sock(sk); 1097 + inet6_destroy_sock(sk); 1098 1098 } 1099 1099 1100 1100 static struct timewait_sock_ops dccp6_timewait_sock_ops = {
+1 -3
net/dccp/proto.c
··· 237 237 238 238 EXPORT_SYMBOL_GPL(dccp_init_sock); 239 239 240 - int dccp_destroy_sock(struct sock *sk) 240 + void dccp_destroy_sock(struct sock *sk) 241 241 { 242 242 struct dccp_sock *dp = dccp_sk(sk); 243 243 struct dccp_minisock *dmsk = dccp_msk(sk); ··· 268 268 269 269 /* clean up feature negotiation state */ 270 270 dccp_feat_clean(dmsk); 271 - 272 - return 0; 273 271 } 274 272 275 273 EXPORT_SYMBOL_GPL(dccp_destroy_sock);
+1 -2
net/ipv4/raw.c
··· 606 606 sk_common_release(sk); 607 607 } 608 608 609 - static int raw_destroy(struct sock *sk) 609 + static void raw_destroy(struct sock *sk) 610 610 { 611 611 lock_sock(sk); 612 612 ip_flush_pending_frames(sk); 613 613 release_sock(sk); 614 - return 0; 615 614 } 616 615 617 616 /* This gets rid of all the nasties in af_inet. -DaveM */
+1 -3
net/ipv4/tcp_ipv4.c
··· 1775 1775 return 0; 1776 1776 } 1777 1777 1778 - int tcp_v4_destroy_sock(struct sock *sk) 1778 + void tcp_v4_destroy_sock(struct sock *sk) 1779 1779 { 1780 1780 struct tcp_sock *tp = tcp_sk(sk); 1781 1781 ··· 1819 1819 } 1820 1820 1821 1821 atomic_dec(&tcp_sockets_allocated); 1822 - 1823 - return 0; 1824 1822 } 1825 1823 1826 1824 EXPORT_SYMBOL(tcp_v4_destroy_sock);
+1 -2
net/ipv4/udp.c
··· 1253 1253 return __udp4_lib_rcv(skb, udp_hash, IPPROTO_UDP); 1254 1254 } 1255 1255 1256 - int udp_destroy_sock(struct sock *sk) 1256 + void udp_destroy_sock(struct sock *sk) 1257 1257 { 1258 1258 lock_sock(sk); 1259 1259 udp_flush_pending_frames(sk); 1260 1260 release_sock(sk); 1261 - return 0; 1262 1261 } 1263 1262 1264 1263 /*
+1 -1
net/ipv4/udp_impl.h
··· 26 26 extern int udp_sendpage(struct sock *sk, struct page *page, int offset, 27 27 size_t size, int flags); 28 28 extern int udp_queue_rcv_skb(struct sock * sk, struct sk_buff *skb); 29 - extern int udp_destroy_sock(struct sock *sk); 29 + extern void udp_destroy_sock(struct sock *sk); 30 30 31 31 #ifdef CONFIG_PROC_FS 32 32 extern int udp4_seq_show(struct seq_file *seq, void *v);
+1 -3
net/ipv6/af_inet6.c
··· 371 371 372 372 EXPORT_SYMBOL(inet6_release); 373 373 374 - int inet6_destroy_sock(struct sock *sk) 374 + void inet6_destroy_sock(struct sock *sk) 375 375 { 376 376 struct ipv6_pinfo *np = inet6_sk(sk); 377 377 struct sk_buff *skb; ··· 389 389 390 390 if ((opt = xchg(&np->opt, NULL)) != NULL) 391 391 sock_kfree_s(sk, opt, opt->tot_len); 392 - 393 - return 0; 394 392 } 395 393 396 394 EXPORT_SYMBOL_GPL(inet6_destroy_sock);
+2 -2
net/ipv6/raw.c
··· 1162 1162 sk_common_release(sk); 1163 1163 } 1164 1164 1165 - static int raw6_destroy(struct sock *sk) 1165 + static void raw6_destroy(struct sock *sk) 1166 1166 { 1167 1167 lock_sock(sk); 1168 1168 ip6_flush_pending_frames(sk); 1169 1169 release_sock(sk); 1170 1170 1171 - return inet6_destroy_sock(sk); 1171 + inet6_destroy_sock(sk); 1172 1172 } 1173 1173 1174 1174 static int rawv6_init_sk(struct sock *sk)
+2 -2
net/ipv6/tcp_ipv6.c
··· 1872 1872 return 0; 1873 1873 } 1874 1874 1875 - static int tcp_v6_destroy_sock(struct sock *sk) 1875 + static void tcp_v6_destroy_sock(struct sock *sk) 1876 1876 { 1877 1877 #ifdef CONFIG_TCP_MD5SIG 1878 1878 /* Clean up the MD5 key list */ ··· 1880 1880 tcp_v6_clear_md5_list(sk); 1881 1881 #endif 1882 1882 tcp_v4_destroy_sock(sk); 1883 - return inet6_destroy_sock(sk); 1883 + inet6_destroy_sock(sk); 1884 1884 } 1885 1885 1886 1886 #ifdef CONFIG_PROC_FS
+1 -3
net/ipv6/udp.c
··· 879 879 goto out; 880 880 } 881 881 882 - int udpv6_destroy_sock(struct sock *sk) 882 + void udpv6_destroy_sock(struct sock *sk) 883 883 { 884 884 lock_sock(sk); 885 885 udp_v6_flush_pending_frames(sk); 886 886 release_sock(sk); 887 887 888 888 inet6_destroy_sock(sk); 889 - 890 - return 0; 891 889 } 892 890 893 891 /*
+1 -1
net/ipv6/udp_impl.h
··· 29 29 struct msghdr *msg, size_t len, 30 30 int noblock, int flags, int *addr_len); 31 31 extern int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb); 32 - extern int udpv6_destroy_sock(struct sock *sk); 32 + extern void udpv6_destroy_sock(struct sock *sk); 33 33 34 34 #ifdef CONFIG_PROC_FS 35 35 extern int udp6_seq_show(struct seq_file *seq, void *v);
+1 -2
net/sctp/socket.c
··· 3588 3588 } 3589 3589 3590 3590 /* Cleanup any SCTP per socket resources. */ 3591 - SCTP_STATIC int sctp_destroy_sock(struct sock *sk) 3591 + SCTP_STATIC void sctp_destroy_sock(struct sock *sk) 3592 3592 { 3593 3593 struct sctp_endpoint *ep; 3594 3594 ··· 3598 3598 ep = sctp_sk(sk)->ep; 3599 3599 sctp_endpoint_free(ep); 3600 3600 atomic_dec(&sctp_sockets_allocated); 3601 - return 0; 3602 3601 } 3603 3602 3604 3603 /* API 4.1.7 shutdown() - TCP Style Syntax