* [PATCH net-next v2] af_mpls: add null dev check in find_outdev
@ 2015-08-04 13:36 Roopa Prabhu
2015-08-07 5:04 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Roopa Prabhu @ 2015-08-04 13:36 UTC (permalink / raw)
To: davem; +Cc: dan.carpenter, ebiederm, rshearma, netdev
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
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next v2] af_mpls: add null dev check in find_outdev
2015-08-04 13:36 [PATCH net-next v2] af_mpls: add null dev check in find_outdev Roopa Prabhu
@ 2015-08-07 5:04 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-08-07 5:04 UTC (permalink / raw)
To: roopa; +Cc: dan.carpenter, ebiederm, rshearma, netdev
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-08-07 5:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-04 13:36 [PATCH net-next v2] af_mpls: add null dev check in find_outdev Roopa Prabhu
2015-08-07 5:04 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).