lkml.org 
[lkml]   [2015]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH linux-next 2/4] ipvlan: fix possible NULL pointer dereference in ipvlan_get_iflink
Date
Signed-off-by: Honggang Li <honli@redhat.com>
---
drivers/net/ipvlan/ipvlan_main.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c
index 77b92a0..479fcf7 100644
--- a/drivers/net/ipvlan/ipvlan_main.c
+++ b/drivers/net/ipvlan/ipvlan_main.c
@@ -308,7 +308,10 @@ static int ipvlan_get_iflink(const struct net_device *dev)
{
struct ipvl_dev *ipvlan = netdev_priv(dev);

- return ipvlan->phy_dev->ifindex;
+ if (ipvlan && pvlan->phy_dev)
+ return ipvlan->phy_dev->ifindex;
+ else
+ return 0;
}

static const struct net_device_ops ipvlan_netdev_ops = {
--
1.8.3.1


\
 
 \ /
  Last update: 2015-04-14 18:01    [W:0.164 / U:2.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site