Skip to contentSkip to conversation

ipv6: cleanup: remove unneeded null check

PATCH Applied Dan Carpenter 2 participants 2 messages Apr 29, 2010 – Apr 30, 2010

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

PATCH 1/1 ipv6: cleanup: remove unneeded null check

We dereference "sk" unconditionally elsewhere in the function.

This was left over from: b30bd282 "ip6_xmit: remove unnecessary NULL ptr check". According to that commit message, "the sk argument to ip6_xmit is never NULL nowadays since the skb->priority assigment expects a valid socket."

net/ipv6/ip6_output.c +1 -2
index 75d5ef8..d26c6ae 100644
@@ -218,8 +218,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
 			}
 			kfree_skb(skb);
 			skb = skb2;
-			if (sk)
-				skb_set_owner_w(skb, sk);
+			skb_set_owner_w(skb, sk);
 		}
 		if (opt->opt_flen)
 			ipv6_push_frag_opts(skb, opt, &proto);
maintainer Applied
#1 lore raw

From: Dan Carpenter <[email protected]>
Date: Thu, 29 Apr 2010 16:30:35 +0200

Quoted 8 lines

We dereference "sk" unconditionally elsewhere in the function.

This was left over from: b30bd282 "ip6_xmit: remove unnecessary NULL ptr check". According to that commit message, "the sk argument to ip6_xmit is never NULL nowadays since the skb->priority assigment expects a valid socket."

Applied, thanks Dan.