[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1429024817-21561-4-git-send-email-honli@redhat.com>
Date: Tue, 14 Apr 2015 23:20:16 +0800
From: Honggang Li <honli@...hat.com>
To: roland@...nel.org, sean.hefty@...el.com, hal.rosenstock@...il.com,
kaber@...sh.net, davem@...emloft.net, alex.estrin@...el.com,
dledford@...hat.com, edumazet@...gle.com, erezsh@...lanox.com,
nicolas.dichtel@...nd.com, maheshb@...gle.com, jbenc@...hat.com,
ebiederm@...ssion.com, elfring@...rs.sourceforge.net,
f.fainelli@...il.com, linux@...ck-us.net, andrew@...n.ch,
sfeldma@...il.com, alexander.h.duyck@...el.com,
linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org
Cc: Honggang Li <honli@...hat.com>
Subject: [PATCH linux-next 3/4] macvlan: fix possible NULL pointer dereference in macvlan_dev_get_iflink
Signed-off-by: Honggang Li <honli@...hat.com>
---
drivers/net/macvlan.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index b227a13..1e59f39 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -998,7 +998,9 @@ static int macvlan_dev_get_iflink(const struct net_device *dev)
{
struct macvlan_dev *vlan = netdev_priv(dev);
- return vlan->lowerdev->ifindex;
+ if (vlan && vlan->lowerdev)
+ return vlan->lowerdev->ifindex;
+ return 0;
}
static const struct ethtool_ops macvlan_ethtool_ops = {
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists