Commit aaecbc98 authored by David S. Miller's avatar David S. Miller

[IPV6]: ndisc_dst_alloc can never get a NULL dev.

parent d6667fe4
......@@ -583,15 +583,14 @@ struct dst_entry *ndisc_dst_alloc(struct net_device *dev,
if (unlikely(rt == NULL))
goto out;
if (dev)
dev_hold(dev);
dev_hold(dev);
if (neigh)
neigh_hold(neigh);
else
neigh = ndisc_get_neigh(dev, addr);
rt->rt6i_dev = dev;
rt->rt6i_idev = dev ? in6_dev_get(dev) : NULL;
rt->rt6i_idev = in6_dev_get(dev);
rt->rt6i_nexthop = neigh;
rt->rt6i_expires = 0;
rt->rt6i_flags = RTF_LOCAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment