mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] NET: ipv6, remove unnecessary check
       [not found] <20100110103528.GA4769@x200>
@ 2010-01-10 10:43 ` Jiri Slaby
  2010-01-10 21:28   ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Slaby @ 2010-01-10 10:43 UTC (permalink / raw)
  To: davem
  Cc: adobriyan, linux-kernel, jirislaby, Alexey Kuznetsov,
	Pekka Savola (ipv6),
	James Morris, Hideaki YOSHIFUJI, Patrick McHardy, netdev

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
---
 net/ipv6/proc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index c9605c3..7b197b7 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -259,7 +259,7 @@ int snmp6_unregister_dev(struct inet6_dev *idev)
 	struct net *net = dev_net(idev->dev);
 	if (!net->mib.proc_net_devsnmp6)
 		return -ENOENT;
-	if (!idev || !idev->stats.proc_dir_entry)
+	if (!idev->stats.proc_dir_entry)
 		return -EINVAL;
 	remove_proc_entry(idev->stats.proc_dir_entry->name,
 			  net->mib.proc_net_devsnmp6);
-- 
1.6.5.7


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] NET: ipv6, remove unnecessary check
  2010-01-10 10:43 ` [PATCH 1/1] NET: ipv6, remove unnecessary check Jiri Slaby
@ 2010-01-10 21:28   ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-01-10 21:28 UTC (permalink / raw)
  To: jslaby
  Cc: adobriyan, linux-kernel, jirislaby, kuznet, pekkas, jmorris,
	yoshfuji, kaber, netdev

From: Jiri Slaby <jslaby@suse.cz>
Date: Sun, 10 Jan 2010 11:43:03 +0100

> 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>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-10 21:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20100110103528.GA4769@x200>
2010-01-10 10:43 ` [PATCH 1/1] NET: ipv6, remove unnecessary check Jiri Slaby
2010-01-10 21:28   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®