hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/drivers/infiniband/core/roce_gid_mgmt.c
....@@ -330,6 +330,7 @@
330330 static void enum_netdev_ipv4_ips(struct ib_device *ib_dev,
331331 u8 port, struct net_device *ndev)
332332 {
333
+ const struct in_ifaddr *ifa;
333334 struct in_device *in_dev;
334335 struct sin_list {
335336 struct list_head list;
....@@ -349,7 +350,7 @@
349350 return;
350351 }
351352
352
- for_ifa(in_dev) {
353
+ in_dev_for_each_ifa_rcu(ifa, in_dev) {
353354 struct sin_list *entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
354355
355356 if (!entry)
....@@ -359,7 +360,7 @@
359360 entry->ip.sin_addr.s_addr = ifa->ifa_address;
360361 list_add_tail(&entry->list, &sin_list);
361362 }
362
- endfor_ifa(in_dev);
363
+
363364 rcu_read_unlock();
364365
365366 list_for_each_entry_safe(sin_iter, sin_temp, &sin_list, list) {
....@@ -530,10 +531,11 @@
530531 struct net_device *upper;
531532 };
532533
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)
534536 {
535537 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;
537539
538540 if (!entry)
539541 return 0;
....@@ -552,12 +554,14 @@
552554 struct net_device *ndev))
553555 {
554556 struct net_device *ndev = cookie;
557
+ struct netdev_nested_priv priv;
555558 struct upper_list *upper_iter;
556559 struct upper_list *upper_temp;
557560 LIST_HEAD(upper_list);
558561
562
+ priv.data = &upper_list;
559563 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);
561565 rcu_read_unlock();
562566
563567 handle_netdev(ib_dev, port, ndev);