diff --git a/net/ipv6/route.c b/net/ipv6/route.c index d0f9e66d1..b134f6abf 100755 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -3490,7 +3490,7 @@ int fib6_nh_init(struct net *net, struct fib6_nh *fib6_nh, if (!dev) goto out; - if (idev->cnf.disable_ipv6) { + if (!idev || idev->cnf.disable_ipv6) { NL_SET_ERR_MSG(extack, "IPv6 is disabled on nexthop device"); err = -EACCES; goto out;