aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/route.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r--net/ipv4/route.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 6b95f74..37be8f6 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2751,10 +2751,15 @@ static struct rtable *ip_route_output_slow(struct net *net, struct flowi4 *fl4)
res.type == RTN_UNICAST && !fl4->flowi4_oif)
fib_select_default(&res);
+ dev_out = FIB_RES_DEV(res);
+ if (dev_out == NULL) {
+ rth = ERR_PTR(-ENODEV);
+ goto out;
+ }
+
if (!fl4->saddr)
fl4->saddr = FIB_RES_PREFSRC(net, res);
- dev_out = FIB_RES_DEV(res);
fl4->flowi4_oif = dev_out->ifindex;