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>
This commit is contained in:
Roopa Prabhu 2015-08-04 06:36:24 -07:00 коммит произвёл David S. Miller
Родитель 3c62181840
Коммит 3dcb615e68
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -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;
} }