Skip to content

Commit 88343fb

Browse files
committed
Merge tag 'wireless-2023-10-18' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless
Johannes Berg says: ==================== A few more fixes: * prevent value bounce/glitch in rfkill GPIO probe * fix lockdep report in rfkill * fix error path leak in mac80211 key handling * use system_unbound_wq for wiphy work since it can take longer * tag 'wireless-2023-10-18' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless: net: rfkill: reduce data->mtx scope in rfkill_fop_open net: rfkill: gpio: prevent value glitch during probe wifi: mac80211: fix error path key leak wifi: cfg80211: use system_unbound_wq for wiphy work ==================== Link: https://lore.kernel.org/r/20231018071041.8175-2-johannes@sipsolutions.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 6200e00 + f2ac54e commit 88343fb

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

net/mac80211/key.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,7 @@ int ieee80211_key_link(struct ieee80211_key *key,
912912
*/
913913
if (ieee80211_key_identical(sdata, old_key, key)) {
914914
ret = -EALREADY;
915-
goto unlock;
915+
goto out;
916916
}
917917

918918
key->local = sdata->local;
@@ -940,7 +940,6 @@ int ieee80211_key_link(struct ieee80211_key *key,
940940

941941
out:
942942
ieee80211_key_free_unused(key);
943-
unlock:
944943
mutex_unlock(&sdata->local->key_mtx);
945944

946945
return ret;

net/rfkill/core.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,7 +1180,6 @@ static int rfkill_fop_open(struct inode *inode, struct file *file)
11801180
init_waitqueue_head(&data->read_wait);
11811181

11821182
mutex_lock(&rfkill_global_mutex);
1183-
mutex_lock(&data->mtx);
11841183
/*
11851184
* start getting events from elsewhere but hold mtx to get
11861185
* startup events added first
@@ -1192,18 +1191,18 @@ static int rfkill_fop_open(struct inode *inode, struct file *file)
11921191
goto free;
11931192
rfkill_sync(rfkill);
11941193
rfkill_fill_event(&ev->ev, rfkill, RFKILL_OP_ADD);
1194+
mutex_lock(&data->mtx);
11951195
list_add_tail(&ev->list, &data->events);
1196+
mutex_unlock(&data->mtx);
11961197
}
11971198
list_add(&data->list, &rfkill_fds);
1198-
mutex_unlock(&data->mtx);
11991199
mutex_unlock(&rfkill_global_mutex);
12001200

12011201
file->private_data = data;
12021202

12031203
return stream_open(inode, file);
12041204

12051205
free:
1206-
mutex_unlock(&data->mtx);
12071206
mutex_unlock(&rfkill_global_mutex);
12081207
mutex_destroy(&data->mtx);
12091208
list_for_each_entry_safe(ev, tmp, &data->events, list)

net/rfkill/rfkill-gpio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
108108

109109
rfkill->clk = devm_clk_get(&pdev->dev, NULL);
110110

111-
gpio = devm_gpiod_get_optional(&pdev->dev, "reset", GPIOD_OUT_LOW);
111+
gpio = devm_gpiod_get_optional(&pdev->dev, "reset", GPIOD_ASIS);
112112
if (IS_ERR(gpio))
113113
return PTR_ERR(gpio);
114114

115115
rfkill->reset_gpio = gpio;
116116

117-
gpio = devm_gpiod_get_optional(&pdev->dev, "shutdown", GPIOD_OUT_LOW);
117+
gpio = devm_gpiod_get_optional(&pdev->dev, "shutdown", GPIOD_ASIS);
118118
if (IS_ERR(gpio))
119119
return PTR_ERR(gpio);
120120

net/wireless/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1622,7 +1622,7 @@ void wiphy_work_queue(struct wiphy *wiphy, struct wiphy_work *work)
16221622
list_add_tail(&work->entry, &rdev->wiphy_work_list);
16231623
spin_unlock_irqrestore(&rdev->wiphy_work_lock, flags);
16241624

1625-
schedule_work(&rdev->wiphy_work);
1625+
queue_work(system_unbound_wq, &rdev->wiphy_work);
16261626
}
16271627
EXPORT_SYMBOL_GPL(wiphy_work_queue);
16281628

0 commit comments

Comments
 (0)