diff --git a/net/ipv6/route.c b/net/ipv6/route.c index b9805059e494c39a14b37649bb30701eee9a36e8..45be9e9c595ff5582aa576cbf3408fbdb39f2ebe 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -3485,7 +3485,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;