diff --git a/net/ipv4/route.c b/net/ipv4/route.c index b7cba4bdc578..cc409cc0789c 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -2088,6 +2088,9 @@ int ip_route_use_hint(struct sk_buff *skb, __be32 daddr, __be32 saddr, int err = -EINVAL; u32 tag = 0; + if (!in_dev) + return -EINVAL; + if (ipv4_is_multicast(saddr) || ipv4_is_lbcast(saddr)) goto martian_source;