netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [2.6 patch] __inet6_csk_dst_store(): fix check-after-use
@ 2007-10-14 17:52 Adrian Bunk
  2007-10-15  2:45 ` Masahide NAKAMURA
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Bunk @ 2007-10-14 17:52 UTC (permalink / raw)
  To: Noriaki TAKAMIYA, Masahide NAKAMURA; +Cc: netdev, linux-kernel

The Coverity checker spotted that we have already oops'ed if "dst"
was NULL.

Since "dst" being NULL doesn't seem to be possible at this point this 
patch removes the NULL check.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---
eeb6009cf3ef5f6993ced359330d877680617a70 
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c
index 25b9317..78de42a 100644
--- a/net/ipv6/inet6_connection_sock.c
+++ b/net/ipv6/inet6_connection_sock.c
@@ -146,7 +146,7 @@ void __inet6_csk_dst_store(struct sock *sk, struct dst_entry *dst,
 	__ip6_dst_store(sk, dst, daddr, saddr);
 
 #ifdef CONFIG_XFRM
-	if (dst) {
+	{
 		struct rt6_info *rt = (struct rt6_info  *)dst;
 		rt->rt6i_flow_cache_genid = atomic_read(&flow_cache_genid);
 	}

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

* Re: [2.6 patch] __inet6_csk_dst_store(): fix check-after-use
  2007-10-14 17:52 [2.6 patch] __inet6_csk_dst_store(): fix check-after-use Adrian Bunk
@ 2007-10-15  2:45 ` Masahide NAKAMURA
  2007-10-15  3:37   ` Noriaki TAKAMIYA
  0 siblings, 1 reply; 4+ messages in thread
From: Masahide NAKAMURA @ 2007-10-15  2:45 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Noriaki TAKAMIYA, netdev, linux-kernel


On Sun, 14 Oct 2007 19:52:12 +0200
Adrian Bunk <bunk@kernel.org> wrote:

> The Coverity checker spotted that we have already oops'ed if "dst"
> was NULL.
> 
> Since "dst" being NULL doesn't seem to be possible at this point this 
> patch removes the NULL check.
> 
> Signed-off-by: Adrian Bunk <bunk@stusta.de>

Agreed.

Acked-by: Masahide NAKAMURA <nakam@linux-ipv6.org>

-- 
Masahide NAKAMURA


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

* Re: [2.6 patch] __inet6_csk_dst_store(): fix check-after-use
  2007-10-15  2:45 ` Masahide NAKAMURA
@ 2007-10-15  3:37   ` Noriaki TAKAMIYA
  2007-10-15  8:38     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Noriaki TAKAMIYA @ 2007-10-15  3:37 UTC (permalink / raw)
  To: nakam; +Cc: bunk, netdev, linux-kernel

Hi,

>> Mon, 15 Oct 2007 11:45:10 +0900
>> [Subject: Re: [2.6 patch] __inet6_csk_dst_store(): fix check-after-use]
>> Masahide NAKAMURA <nakam@linux-ipv6.org> wrote...

> 
> On Sun, 14 Oct 2007 19:52:12 +0200
> Adrian Bunk <bunk@kernel.org> wrote:
> 
> > The Coverity checker spotted that we have already oops'ed if "dst"
> > was NULL.
> > 
> > Since "dst" being NULL doesn't seem to be possible at this point this 
> > patch removes the NULL check.
> > 
> > Signed-off-by: Adrian Bunk <bunk@stusta.de>
> 
> Agreed.
> 
> Acked-by: Masahide NAKAMURA <nakam@linux-ipv6.org>

  I also agreed.
  
Acked-by: Noriaki TAKAMIYA <takamiya@po.ntts.co.jp>

--
Noriaki TAKAMIYA

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

* Re: [2.6 patch] __inet6_csk_dst_store(): fix check-after-use
  2007-10-15  3:37   ` Noriaki TAKAMIYA
@ 2007-10-15  8:38     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2007-10-15  8:38 UTC (permalink / raw)
  To: takamiya; +Cc: nakam, bunk, netdev, linux-kernel

From: Noriaki TAKAMIYA <takamiya@po.ntts.co.jp>
Date: Mon, 15 Oct 2007 12:37:49 +0900 (JST)

> > 
> > On Sun, 14 Oct 2007 19:52:12 +0200
> > Adrian Bunk <bunk@kernel.org> wrote:
> > 
> > > The Coverity checker spotted that we have already oops'ed if "dst"
> > > was NULL.
> > > 
> > > Since "dst" being NULL doesn't seem to be possible at this point this 
> > > patch removes the NULL check.
> > > 
> > > Signed-off-by: Adrian Bunk <bunk@stusta.de>
> > 
> > Agreed.
> > 
> > Acked-by: Masahide NAKAMURA <nakam@linux-ipv6.org>
> 
>   I also agreed.
>   
> Acked-by: Noriaki TAKAMIYA <takamiya@po.ntts.co.jp>

Patch applied, thanks everyone!

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

end of thread, other threads:[~2007-10-15  8:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-14 17:52 [2.6 patch] __inet6_csk_dst_store(): fix check-after-use Adrian Bunk
2007-10-15  2:45 ` Masahide NAKAMURA
2007-10-15  3:37   ` Noriaki TAKAMIYA
2007-10-15  8:38     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).