aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_ipv6.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bonding/bond_ipv6.c')
-rw-r--r--drivers/net/bonding/bond_ipv6.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/bonding/bond_ipv6.c b/drivers/net/bonding/bond_ipv6.c
index 6dd64cf3cb76..969ffed86b9f 100644
--- a/drivers/net/bonding/bond_ipv6.c
+++ b/drivers/net/bonding/bond_ipv6.c
@@ -37,7 +37,6 @@
37static void bond_glean_dev_ipv6(struct net_device *dev, struct in6_addr *addr) 37static void bond_glean_dev_ipv6(struct net_device *dev, struct in6_addr *addr)
38{ 38{
39 struct inet6_dev *idev; 39 struct inet6_dev *idev;
40 struct inet6_ifaddr *ifa;
41 40
42 if (!dev) 41 if (!dev)
43 return; 42 return;
@@ -47,10 +46,12 @@ static void bond_glean_dev_ipv6(struct net_device *dev, struct in6_addr *addr)
47 return; 46 return;
48 47
49 read_lock_bh(&idev->lock); 48 read_lock_bh(&idev->lock);
50 ifa = idev->addr_list; 49 if (!list_empty(&idev->addr_list)) {
51 if (ifa) 50 struct inet6_ifaddr *ifa
51 = list_first_entry(&idev->addr_list,
52 struct inet6_ifaddr, if_list);
52 ipv6_addr_copy(addr, &ifa->addr); 53 ipv6_addr_copy(addr, &ifa->addr);
53 else 54 } else
54 ipv6_addr_set(addr, 0, 0, 0, 0); 55 ipv6_addr_set(addr, 0, 0, 0, 0);
55 56
56 read_unlock_bh(&idev->lock); 57 read_unlock_bh(&idev->lock);