Skip to contentSkip to conversation

__inet6_csk_dst_store(): fix check-after-use

PATCH In review Adrian Bunk 4 participants 4 messages Oct 14, 2007 – Oct 15, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 __inet6_csk_dst_store(): fix check-after-use

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.

---
eeb6009cf3ef5f6993ced359330d877680617a70

net/ipv6/inet6_connection_sock.c +1 -1
index 25b9317..78de42a 100644
@@ -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);
 	}
#2 lore raw

Hi,

Quoted 11 lines
Quoted 3 lines

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

Quoted 3 lines · On Sun, 14 Oct 2007 19:52:12 +0200 Adrian Bunk <[email protected]> wrote:

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

Quoted 8 lines
Quoted 4 lines

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

Agreed.

I also agreed.

--
Noriaki TAKAMIYA

maintainer
#3 lore raw

From: Noriaki TAKAMIYA <[email protected]>
Date: Mon, 15 Oct 2007 12:37:49 +0900 (JST)

Quoted 12 lines
Quoted 12 lines
Quoted 7 lines · On Sun, 14 Oct 2007 19:52:12 +0200 Adrian Bunk <[email protected]> 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.

Quoted 7 lines
Quoted 3 lines

Agreed.

I also agreed.

Patch applied, thanks everyone!