summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorRoopa Prabhu <roopa@cumulusnetworks.com>2015-08-04 06:36:24 -0700
committerDavid S. Miller <davem@davemloft.net>2015-08-06 22:03:58 -0700
commit3dcb615e6841eb945a49f605743a6923ed591400 (patch)
treec12c22a5ce9e0d80d208c9a4dfbee79754ca24cb /net
parent3c621818404bbb0bed1a8892d843b499182fa7e9 (diff)
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')
-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;
}