Commit a05e1513 authored by Mustafa Ismail's avatar Mustafa Ismail Committed by Doug Ledford

i40iw: Replace list_for_each_entry macro with safe version

Use list_for_each_entry_safe macro for the IPv6 addr list
as IPv6 addresses can be deleted while going through the
list.
Signed-off-by: default avatarMustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: default avatarShiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent e5e74b61
...@@ -1644,7 +1644,7 @@ static enum i40iw_status_code i40iw_add_mqh_6(struct i40iw_device *iwdev, ...@@ -1644,7 +1644,7 @@ static enum i40iw_status_code i40iw_add_mqh_6(struct i40iw_device *iwdev,
{ {
struct net_device *ip_dev; struct net_device *ip_dev;
struct inet6_dev *idev; struct inet6_dev *idev;
struct inet6_ifaddr *ifp; struct inet6_ifaddr *ifp, *tmp;
enum i40iw_status_code ret = 0; enum i40iw_status_code ret = 0;
struct i40iw_cm_listener *child_listen_node; struct i40iw_cm_listener *child_listen_node;
unsigned long flags; unsigned long flags;
...@@ -1659,7 +1659,7 @@ static enum i40iw_status_code i40iw_add_mqh_6(struct i40iw_device *iwdev, ...@@ -1659,7 +1659,7 @@ static enum i40iw_status_code i40iw_add_mqh_6(struct i40iw_device *iwdev,
i40iw_pr_err("idev == NULL\n"); i40iw_pr_err("idev == NULL\n");
break; break;
} }
list_for_each_entry(ifp, &idev->addr_list, if_list) { list_for_each_entry_safe(ifp, tmp, &idev->addr_list, if_list) {
i40iw_debug(&iwdev->sc_dev, i40iw_debug(&iwdev->sc_dev,
I40IW_DEBUG_CM, I40IW_DEBUG_CM,
"IP=%pI6, vlan_id=%d, MAC=%pM\n", "IP=%pI6, vlan_id=%d, MAC=%pM\n",
......
...@@ -1164,7 +1164,7 @@ static void i40iw_add_ipv6_addr(struct i40iw_device *iwdev) ...@@ -1164,7 +1164,7 @@ static void i40iw_add_ipv6_addr(struct i40iw_device *iwdev)
{ {
struct net_device *ip_dev; struct net_device *ip_dev;
struct inet6_dev *idev; struct inet6_dev *idev;
struct inet6_ifaddr *ifp; struct inet6_ifaddr *ifp, *tmp;
u32 local_ipaddr6[4]; u32 local_ipaddr6[4];
rcu_read_lock(); rcu_read_lock();
...@@ -1177,7 +1177,7 @@ static void i40iw_add_ipv6_addr(struct i40iw_device *iwdev) ...@@ -1177,7 +1177,7 @@ static void i40iw_add_ipv6_addr(struct i40iw_device *iwdev)
i40iw_pr_err("ipv6 inet device not found\n"); i40iw_pr_err("ipv6 inet device not found\n");
break; break;
} }
list_for_each_entry(ifp, &idev->addr_list, if_list) { list_for_each_entry_safe(ifp, tmp, &idev->addr_list, if_list) {
i40iw_pr_info("IP=%pI6, vlan_id=%d, MAC=%pM\n", &ifp->addr, i40iw_pr_info("IP=%pI6, vlan_id=%d, MAC=%pM\n", &ifp->addr,
rdma_vlan_dev_vlan_id(ip_dev), ip_dev->dev_addr); rdma_vlan_dev_vlan_id(ip_dev), ip_dev->dev_addr);
i40iw_copy_ip_ntohl(local_ipaddr6, i40iw_copy_ip_ntohl(local_ipaddr6,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment