[IPV6]: Fix for ipv6_setsockopt NULL dereference

I came across this bug in http://bugzilla.kernel.org/show_bug.cgi?id=8155

Signed-off-by: Olaf Kirch <olaf.kirch@oracle.com>
Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by Olaf Kirch and committed by David S. Miller dfee0a72 aabb601b

+1 -1
+1 -1
net/ipv6/ipv6_sockglue.c
··· 413 } 414 415 /* routing header option needs extra check */ 416 - if (optname == IPV6_RTHDR && opt->srcrt) { 417 struct ipv6_rt_hdr *rthdr = opt->srcrt; 418 switch (rthdr->type) { 419 case IPV6_SRCRT_TYPE_0:
··· 413 } 414 415 /* routing header option needs extra check */ 416 + if (optname == IPV6_RTHDR && opt && opt->srcrt) { 417 struct ipv6_rt_hdr *rthdr = opt->srcrt; 418 switch (rthdr->type) { 419 case IPV6_SRCRT_TYPE_0: