diff --git a/net/ipv6/route.c b/net/ipv6/route.c index c72b4117fc75..5cf6e824c0df 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -3798,10 +3798,12 @@ static struct fib6_info *ip6_route_info_create(struct fib6_config *cfg, if (nh) { if (rt->fib6_src.plen) { NL_SET_ERR_MSG(extack, "Nexthops can not be used with source routing"); + err = -EINVAL; goto out_free; } if (!nexthop_get(nh)) { NL_SET_ERR_MSG(extack, "Nexthop has been deleted"); + err = -ENOENT; goto out_free; } rt->nh = nh;