Skip to content

Commit

Permalink
af_mpls: add null dev check in find_outdev
Browse files Browse the repository at this point in the history
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]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
roopa-prabhu authored and davem330 committed Aug 7, 2015
1 parent 3c62181 commit 3dcb615
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/mpls/af_mpls.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 3dcb615

Please sign in to comment.