From 997feb5e7a24ce155c1d3bea9d0b5c6530bb6197 Mon Sep 17 00:00:00 2001 From: "Denis V. Lunev" Date: Fri, 28 Mar 2008 18:24:01 -0700 Subject: [PATCH] [UDP]: No need to check afinfo != NULL in udp_proc_(un)register. udp_proc_register/udp_proc_unregister are called with a static pointer only. Signed-off-by: Denis V. Lunev Signed-off-by: David S. Miller --- net/ipv4/udp.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index d695097be2..eb0c64da26 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -1628,8 +1628,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; @@ -1646,8 +1644,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)); } -- 2.39.5