[UDP]: No need to check afinfo != NULL in udp_proc_(un)register.
authorDenis V. Lunev <den@openvz.org>
Sat, 29 Mar 2008 01:24:01 +0000 (18:24 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 29 Mar 2008 01:24:01 +0000 (18:24 -0700)
udp_proc_register/udp_proc_unregister are called with a static pointer only.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/udp.c

index d695097be2dcaee90d60986c1294177002ebfe3a..eb0c64da2634e162b74e53cbbb5832bf8e54c9dc 100644 (file)
@@ -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));
 }