From: Roopa Prabhu <[email protected]> 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 <[email protected]> Signed-off-by: Roopa Prabhu <[email protected]> --- net/mpls/af_mpls.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c index b6b9a6c..3ea90ff 100644 --- a/net/mpls/af_mpls.c +++ b/net/mpls/af_mpls.c @@ -416,6 +416,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; } -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
