|
5 | 5 | * Copyright 2006-2010 Johannes Berg <[email protected]>
|
6 | 6 | * Copyright 2013-2014 Intel Mobile Communications GmbH
|
7 | 7 | * Copyright 2015-2017 Intel Deutschland GmbH
|
8 |
| - * Copyright (C) 2018-2021 Intel Corporation |
| 8 | + * Copyright (C) 2018-2022 Intel Corporation |
9 | 9 | */
|
10 | 10 |
|
11 | 11 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
@@ -332,29 +332,20 @@ static void cfg80211_event_work(struct work_struct *work)
|
332 | 332 | void cfg80211_destroy_ifaces(struct cfg80211_registered_device *rdev)
|
333 | 333 | {
|
334 | 334 | struct wireless_dev *wdev, *tmp;
|
335 |
| - bool found = false; |
336 | 335 |
|
337 | 336 | ASSERT_RTNL();
|
338 | 337 |
|
339 |
| - list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { |
| 338 | + list_for_each_entry_safe(wdev, tmp, &rdev->wiphy.wdev_list, list) { |
340 | 339 | if (wdev->nl_owner_dead) {
|
341 | 340 | if (wdev->netdev)
|
342 | 341 | dev_close(wdev->netdev);
|
343 |
| - found = true; |
344 |
| - } |
345 |
| - } |
346 |
| - |
347 |
| - if (!found) |
348 |
| - return; |
349 | 342 |
|
350 |
| - wiphy_lock(&rdev->wiphy); |
351 |
| - list_for_each_entry_safe(wdev, tmp, &rdev->wiphy.wdev_list, list) { |
352 |
| - if (wdev->nl_owner_dead) { |
| 343 | + wiphy_lock(&rdev->wiphy); |
353 | 344 | cfg80211_leave(rdev, wdev);
|
354 | 345 | rdev_del_virtual_intf(rdev, wdev);
|
| 346 | + wiphy_unlock(&rdev->wiphy); |
355 | 347 | }
|
356 | 348 | }
|
357 |
| - wiphy_unlock(&rdev->wiphy); |
358 | 349 | }
|
359 | 350 |
|
360 | 351 | static void cfg80211_destroy_iface_wk(struct work_struct *work)
|
|
0 commit comments