Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1527255

[PATCH] ipv6:ipv6_pinfo dereferenced after NULL check

From Manjeet Pawar <manjeet.p@samsung.com>
Newsgroups linux.kernel
Subject [PATCH] ipv6:ipv6_pinfo dereferenced after NULL check
Date 2016-11-22 07:40 +0100
Message-ID <sGcUh-3Bq-3@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


From: Rohit Thapliyal <r.thapliyal@samsung.com>

np checked for NULL and then dereferenced. It should be modified
for NULL case.

Signed-off-by: Rohit Thapliyal <r.thapliyal@samsung.com>
Signed-off-by: Manjeet Pawar <manjeet.p@samsung.com>
---
 net/ipv6/ip6_output.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 1dfc402..c2afa14 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -205,14 +205,15 @@ int ip6_xmit(const struct sock *sk, struct sk_buff *skb, struct flowi6 *fl6,
 	/*
 	 *	Fill in the IPv6 header
 	 */
-	if (np)
+	if (np) {
 		hlimit = np->hop_limit;
+		ip6_flow_hdr(
+					hdr, tclass, ip6_make_flowlabel(
+					net, skb, fl6->flowlabel,
+					np->autoflowlabel, fl6));
+	}
 	if (hlimit < 0)
 		hlimit = ip6_dst_hoplimit(dst);
 
-	ip6_flow_hdr(hdr, tclass, ip6_make_flowlabel(net, skb, fl6->flowlabel,
-				np->autoflowlabel, fl6));
-
 	hdr->payload_len = htons(seg_len);
 	hdr->nexthdr = proto;
 	hdr->hop_limit = hlimit;
-- 
1.9.1

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] ipv6:ipv6_pinfo dereferenced after NULL check Manjeet Pawar <manjeet.p@samsung.com> - 2016-11-22 07:40 +0100
  Re: [PATCH] ipv6:ipv6_pinfo dereferenced after NULL check Hannes Frederic Sowa <hannes@stressinduktion.org> - 2016-11-22 13:30 +0100
    Re: [PATCH] ipv6:ipv6_pinfo dereferenced after NULL check David Miller <davem@davemloft.net> - 2016-11-22 16:10 +0100
  Re: [PATCH] ipv6:ipv6_pinfo dereferenced after NULL check Hannes Frederic Sowa <hannes@stressinduktion.org> - 2016-11-23 12:40 +0100

csiph-web