Message ID | 1438695384-26306-1-git-send-email-roopa@cumulusnetworks.com |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
From: Roopa Prabhu <roopa@cumulusnetworks.com> Date: Tue, 4 Aug 2015 06:36:24 -0700 > From: Roopa Prabhu <roopa@cumulusnetworks.com> > > 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> > --- > v1-v2 : fixed patch version Applied, thanks. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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; }