Skip to content

Commit

Permalink
Merge tag 'wireless-2023-10-18' of git://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/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>
  • Loading branch information
Jakub Kicinski committed Oct 19, 2023
2 parents 6200e00 + f2ac54e commit 88343fb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
3 changes: 1 addition & 2 deletions net/mac80211/key.c
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ int ieee80211_key_link(struct ieee80211_key *key,
*/
if (ieee80211_key_identical(sdata, old_key, key)) {
ret = -EALREADY;
goto unlock;
goto out;
}

key->local = sdata->local;
Expand Down Expand Up @@ -940,7 +940,6 @@ int ieee80211_key_link(struct ieee80211_key *key,

out:
ieee80211_key_free_unused(key);
unlock:
mutex_unlock(&sdata->local->key_mtx);

return ret;
Expand Down
5 changes: 2 additions & 3 deletions net/rfkill/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,6 @@ static int rfkill_fop_open(struct inode *inode, struct file *file)
init_waitqueue_head(&data->read_wait);

mutex_lock(&rfkill_global_mutex);
mutex_lock(&data->mtx);
/*
* start getting events from elsewhere but hold mtx to get
* startup events added first
Expand All @@ -1192,18 +1191,18 @@ static int rfkill_fop_open(struct inode *inode, struct file *file)
goto free;
rfkill_sync(rfkill);
rfkill_fill_event(&ev->ev, rfkill, RFKILL_OP_ADD);
mutex_lock(&data->mtx);
list_add_tail(&ev->list, &data->events);
mutex_unlock(&data->mtx);
}
list_add(&data->list, &rfkill_fds);
mutex_unlock(&data->mtx);
mutex_unlock(&rfkill_global_mutex);

file->private_data = data;

return stream_open(inode, file);

free:
mutex_unlock(&data->mtx);
mutex_unlock(&rfkill_global_mutex);
mutex_destroy(&data->mtx);
list_for_each_entry_safe(ev, tmp, &data->events, list)
Expand Down
4 changes: 2 additions & 2 deletions net/rfkill/rfkill-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ static int rfkill_gpio_probe(struct platform_device *pdev)

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

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

rfkill->reset_gpio = gpio;

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

Expand Down
2 changes: 1 addition & 1 deletion net/wireless/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1622,7 +1622,7 @@ void wiphy_work_queue(struct wiphy *wiphy, struct wiphy_work *work)
list_add_tail(&work->entry, &rdev->wiphy_work_list);
spin_unlock_irqrestore(&rdev->wiphy_work_lock, flags);

schedule_work(&rdev->wiphy_work);
queue_work(system_unbound_wq, &rdev->wiphy_work);
}
EXPORT_SYMBOL_GPL(wiphy_work_queue);

Expand Down

0 comments on commit 88343fb

Please sign in to comment.