Commit 3dcb615e authored by Roopa Prabhu's avatar Roopa Prabhu Committed by David S. Miller

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarRoopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3c621818
...@@ -411,6 +411,9 @@ static struct net_device *find_outdev(struct net *net, ...@@ -411,6 +411,9 @@ static struct net_device *find_outdev(struct net *net,
dev = dev_get_by_index(net, cfg->rc_ifindex); dev = dev_get_by_index(net, cfg->rc_ifindex);
} }
if (!dev)
return ERR_PTR(-ENODEV);
return dev; return dev;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment