aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2012-11-26 12:50:50 -0800
committerDmitry Shmidt <dimitrysh@google.com>2012-11-26 12:50:50 -0800
commitb0dcb85864986085119a4a8ca927a1cfd7a98c16 (patch)
treede2bec8ec5886dadd28bcae3741388201b8b6618 /net/ipv4
parent62897416be271f76b22415be684c0b884947ce25 (diff)
downloadkernel_samsung_tuna-b0dcb85864986085119a4a8ca927a1cfd7a98c16.zip
kernel_samsung_tuna-b0dcb85864986085119a4a8ca927a1cfd7a98c16.tar.gz
kernel_samsung_tuna-b0dcb85864986085119a4a8ca927a1cfd7a98c16.tar.bz2
ipv4: Check if dev_out is NULL in ip_route_output_slow()
Change-Id: If04a8e99942dbe7e099e736dc87c2a49e1e778f9 Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'net/ipv4')
-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;