summaryrefslogtreecommitdiff
path: root/net/mpls
diff options
context:
space:
mode:
authorRoopa Prabhu <roopa@cumulusnetworks.com>2015-08-04 16:36:24 +0300
committerDavid S. Miller <davem@davemloft.net>2015-08-07 08:03:58 +0300
commit3dcb615e6841eb945a49f605743a6923ed591400 (patch)
treec12c22a5ce9e0d80d208c9a4dfbee79754ca24cb /net/mpls
parent3c621818404bbb0bed1a8892d843b499182fa7e9 (diff)
downloadlinux-3dcb615e6841eb945a49f605743a6923ed591400.tar.xz
af_mpls: add null dev check in find_outdev
This patch adds null dev check for the 'cfg->rc_via_table == NEIGH_LINK_TABLE or dev_get_by_index() failed' case Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mpls')
-rw-r--r--net/mpls/af_mpls.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c
index d93c0301ad23..04306989d054 100644
--- a/net/mpls/af_mpls.c
+++ b/net/mpls/af_mpls.c
@@ -411,6 +411,9 @@ static struct net_device *find_outdev(struct net *net,
dev = dev_get_by_index(net, cfg->rc_ifindex);
}
+ if (!dev)
+ return ERR_PTR(-ENODEV);
+
return dev;
}