diff options
author | Roopa Prabhu <roopa@cumulusnetworks.com> | 2015-08-04 06:36:24 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-08-06 22:03:58 -0700 |
commit | 3dcb615e6841eb945a49f605743a6923ed591400 (patch) | |
tree | c12c22a5ce9e0d80d208c9a4dfbee79754ca24cb /net/mpls | |
parent | 3c621818404bbb0bed1a8892d843b499182fa7e9 (diff) | |
download | lwn-3dcb615e6841eb945a49f605743a6923ed591400.tar.gz lwn-3dcb615e6841eb945a49f605743a6923ed591400.zip |
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.c | 3 |
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; } |