aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/proc.c
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2010-01-09 19:43:03 -0500
committerDavid S. Miller <davem@davemloft.net>2010-01-10 16:27:57 -0500
commitc3f6c21d6e60e39c81c27f18ebad9c7615eff545 (patch)
treedd727510c7263325fabafd6f75893d65b6af71df /net/ipv6/proc.c
parent51f5300682f5925a11edfddfd47ed47376871974 (diff)
NET: ipv6, remove unnecessary check
Stanse found a potential null dereference in snmp6_unregister_dev. There is a check for idev being NULL, but it is dereferenced earlier. But idev cannot be NULL when passed to snmp6_unregister_dev, so remove the test. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: "David S. Miller" <davem@davemloft.net> Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> Cc: "Pekka Savola (ipv6)" <pekkas@netcore.fi> Cc: James Morris <jmorris@namei.org> Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org> Cc: Patrick McHardy <kaber@trash.net> Cc: netdev@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/proc.c')
-rw-r--r--net/ipv6/proc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index c9605c3ad91f..7b197b7132e0 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -259,7 +259,7 @@ int snmp6_unregister_dev(struct inet6_dev *idev)
259 struct net *net = dev_net(idev->dev); 259 struct net *net = dev_net(idev->dev);
260 if (!net->mib.proc_net_devsnmp6) 260 if (!net->mib.proc_net_devsnmp6)
261 return -ENOENT; 261 return -ENOENT;
262 if (!idev || !idev->stats.proc_dir_entry) 262 if (!idev->stats.proc_dir_entry)
263 return -EINVAL; 263 return -EINVAL;
264 remove_proc_entry(idev->stats.proc_dir_entry->name, 264 remove_proc_entry(idev->stats.proc_dir_entry->name,
265 net->mib.proc_net_devsnmp6); 265 net->mib.proc_net_devsnmp6);