Thread (8 messages) 8 messages, 2 authors, 2008-03-29
STALE6641d

[PATCH 2/6 net-2.6.26] [UDP]: No need to check afinfo != NULL in udp_proc_(un)register.

From: Denis V. Lunev <hidden>
Date: 2008-03-27 14:11:09
Subsystem: networking [general], the rest, user datagram protocol (udp) · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds, Willem de Bruijn

udp_proc_register/udp_proc_unregister are called with a static pointer only.

Signed-off-by: Denis V. Lunev <redacted>
---
 net/ipv4/udp.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 6d740ad..c05f45b 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1631,8 +1631,6 @@ int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo)
 	struct proc_dir_entry *p;
 	int rc = 0;
 
-	if (!afinfo)
-		return -EINVAL;
 	afinfo->seq_fops->owner		= afinfo->owner;
 	afinfo->seq_fops->open		= udp_seq_open;
 	afinfo->seq_fops->read		= seq_read;
@@ -1649,8 +1647,6 @@ int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo)
 
 void udp_proc_unregister(struct net *net, struct udp_seq_afinfo *afinfo)
 {
-	if (!afinfo)
-		return;
 	proc_net_remove(net, afinfo->name);
 	memset(afinfo->seq_fops, 0, sizeof(*afinfo->seq_fops));
 }
-- 
1.5.3.rc5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help