From: Dmitry Shmidt Date: Mon, 26 Nov 2012 20:50:50 +0000 (-0800) Subject: ipv4: Check if dev_out is NULL in ip_route_output_slow() X-Git-Tag: firefly_0821_release~7613^2~16 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b0dcb85864986085119a4a8ca927a1cfd7a98c16;p=firefly-linux-kernel-4.4.55.git ipv4: Check if dev_out is NULL in ip_route_output_slow() Change-Id: If04a8e99942dbe7e099e736dc87c2a49e1e778f9 Signed-off-by: Dmitry Shmidt --- diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 6b95f74a91d3..37be8f654866 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;