| .. | .. |
|---|
| 330 | 330 | static void enum_netdev_ipv4_ips(struct ib_device *ib_dev, |
|---|
| 331 | 331 | u8 port, struct net_device *ndev) |
|---|
| 332 | 332 | { |
|---|
| 333 | + const struct in_ifaddr *ifa; |
|---|
| 333 | 334 | struct in_device *in_dev; |
|---|
| 334 | 335 | struct sin_list { |
|---|
| 335 | 336 | struct list_head list; |
|---|
| .. | .. |
|---|
| 349 | 350 | return; |
|---|
| 350 | 351 | } |
|---|
| 351 | 352 | |
|---|
| 352 | | - for_ifa(in_dev) { |
|---|
| 353 | + in_dev_for_each_ifa_rcu(ifa, in_dev) { |
|---|
| 353 | 354 | struct sin_list *entry = kzalloc(sizeof(*entry), GFP_ATOMIC); |
|---|
| 354 | 355 | |
|---|
| 355 | 356 | if (!entry) |
|---|
| .. | .. |
|---|
| 359 | 360 | entry->ip.sin_addr.s_addr = ifa->ifa_address; |
|---|
| 360 | 361 | list_add_tail(&entry->list, &sin_list); |
|---|
| 361 | 362 | } |
|---|
| 362 | | - endfor_ifa(in_dev); |
|---|
| 363 | + |
|---|
| 363 | 364 | rcu_read_unlock(); |
|---|
| 364 | 365 | |
|---|
| 365 | 366 | list_for_each_entry_safe(sin_iter, sin_temp, &sin_list, list) { |
|---|
| .. | .. |
|---|
| 530 | 531 | struct net_device *upper; |
|---|
| 531 | 532 | }; |
|---|
| 532 | 533 | |
|---|
| 533 | | -static int netdev_upper_walk(struct net_device *upper, void *data) |
|---|
| 534 | +static int netdev_upper_walk(struct net_device *upper, |
|---|
| 535 | + struct netdev_nested_priv *priv) |
|---|
| 534 | 536 | { |
|---|
| 535 | 537 | struct upper_list *entry = kmalloc(sizeof(*entry), GFP_ATOMIC); |
|---|
| 536 | | - struct list_head *upper_list = data; |
|---|
| 538 | + struct list_head *upper_list = (struct list_head *)priv->data; |
|---|
| 537 | 539 | |
|---|
| 538 | 540 | if (!entry) |
|---|
| 539 | 541 | return 0; |
|---|
| .. | .. |
|---|
| 552 | 554 | struct net_device *ndev)) |
|---|
| 553 | 555 | { |
|---|
| 554 | 556 | struct net_device *ndev = cookie; |
|---|
| 557 | + struct netdev_nested_priv priv; |
|---|
| 555 | 558 | struct upper_list *upper_iter; |
|---|
| 556 | 559 | struct upper_list *upper_temp; |
|---|
| 557 | 560 | LIST_HEAD(upper_list); |
|---|
| 558 | 561 | |
|---|
| 562 | + priv.data = &upper_list; |
|---|
| 559 | 563 | rcu_read_lock(); |
|---|
| 560 | | - netdev_walk_all_upper_dev_rcu(ndev, netdev_upper_walk, &upper_list); |
|---|
| 564 | + netdev_walk_all_upper_dev_rcu(ndev, netdev_upper_walk, &priv); |
|---|
| 561 | 565 | rcu_read_unlock(); |
|---|
| 562 | 566 | |
|---|
| 563 | 567 | handle_netdev(ib_dev, port, ndev); |
|---|