Commit 1abf4fb2 authored by Denis V. Lunev's avatar Denis V. Lunev Committed by David S. Miller

[TCP]: No need to check afinfo != NULL in tcp_proc_(un)register.

tcp_proc_register/tcp_proc_unregister are called with a static pointer only.
Signed-off-by: default avatarDenis V. Lunev <den@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a4146b1b
...@@ -2263,8 +2263,6 @@ int tcp_proc_register(struct net *net, struct tcp_seq_afinfo *afinfo) ...@@ -2263,8 +2263,6 @@ int tcp_proc_register(struct net *net, struct tcp_seq_afinfo *afinfo)
int rc = 0; int rc = 0;
struct proc_dir_entry *p; struct proc_dir_entry *p;
if (!afinfo)
return -EINVAL;
afinfo->seq_fops->owner = afinfo->owner; afinfo->seq_fops->owner = afinfo->owner;
afinfo->seq_fops->open = tcp_seq_open; afinfo->seq_fops->open = tcp_seq_open;
afinfo->seq_fops->read = seq_read; afinfo->seq_fops->read = seq_read;
...@@ -2281,8 +2279,6 @@ int tcp_proc_register(struct net *net, struct tcp_seq_afinfo *afinfo) ...@@ -2281,8 +2279,6 @@ int tcp_proc_register(struct net *net, struct tcp_seq_afinfo *afinfo)
void tcp_proc_unregister(struct net *net, struct tcp_seq_afinfo *afinfo) void tcp_proc_unregister(struct net *net, struct tcp_seq_afinfo *afinfo)
{ {
if (!afinfo)
return;
proc_net_remove(net, afinfo->name); proc_net_remove(net, afinfo->name);
memset(afinfo->seq_fops, 0, sizeof(*afinfo->seq_fops)); memset(afinfo->seq_fops, 0, sizeof(*afinfo->seq_fops));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment