Commit 88343fbe authored by Jakub Kicinski's avatar Jakub Kicinski

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.netSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 6200e00e f2ac54eb
...@@ -912,7 +912,7 @@ int ieee80211_key_link(struct ieee80211_key *key, ...@@ -912,7 +912,7 @@ int ieee80211_key_link(struct ieee80211_key *key,
*/ */
if (ieee80211_key_identical(sdata, old_key, key)) { if (ieee80211_key_identical(sdata, old_key, key)) {
ret = -EALREADY; ret = -EALREADY;
goto unlock; goto out;
} }
key->local = sdata->local; key->local = sdata->local;
...@@ -940,7 +940,6 @@ int ieee80211_key_link(struct ieee80211_key *key, ...@@ -940,7 +940,6 @@ int ieee80211_key_link(struct ieee80211_key *key,
out: out:
ieee80211_key_free_unused(key); ieee80211_key_free_unused(key);
unlock:
mutex_unlock(&sdata->local->key_mtx); mutex_unlock(&sdata->local->key_mtx);
return ret; return ret;
......
...@@ -1180,7 +1180,6 @@ static int rfkill_fop_open(struct inode *inode, struct file *file) ...@@ -1180,7 +1180,6 @@ static int rfkill_fop_open(struct inode *inode, struct file *file)
init_waitqueue_head(&data->read_wait); init_waitqueue_head(&data->read_wait);
mutex_lock(&rfkill_global_mutex); mutex_lock(&rfkill_global_mutex);
mutex_lock(&data->mtx);
/* /*
* start getting events from elsewhere but hold mtx to get * start getting events from elsewhere but hold mtx to get
* startup events added first * startup events added first
...@@ -1192,10 +1191,11 @@ static int rfkill_fop_open(struct inode *inode, struct file *file) ...@@ -1192,10 +1191,11 @@ static int rfkill_fop_open(struct inode *inode, struct file *file)
goto free; goto free;
rfkill_sync(rfkill); rfkill_sync(rfkill);
rfkill_fill_event(&ev->ev, rfkill, RFKILL_OP_ADD); rfkill_fill_event(&ev->ev, rfkill, RFKILL_OP_ADD);
mutex_lock(&data->mtx);
list_add_tail(&ev->list, &data->events); list_add_tail(&ev->list, &data->events);
mutex_unlock(&data->mtx);
} }
list_add(&data->list, &rfkill_fds); list_add(&data->list, &rfkill_fds);
mutex_unlock(&data->mtx);
mutex_unlock(&rfkill_global_mutex); mutex_unlock(&rfkill_global_mutex);
file->private_data = data; file->private_data = data;
...@@ -1203,7 +1203,6 @@ static int rfkill_fop_open(struct inode *inode, struct file *file) ...@@ -1203,7 +1203,6 @@ static int rfkill_fop_open(struct inode *inode, struct file *file)
return stream_open(inode, file); return stream_open(inode, file);
free: free:
mutex_unlock(&data->mtx);
mutex_unlock(&rfkill_global_mutex); mutex_unlock(&rfkill_global_mutex);
mutex_destroy(&data->mtx); mutex_destroy(&data->mtx);
list_for_each_entry_safe(ev, tmp, &data->events, list) list_for_each_entry_safe(ev, tmp, &data->events, list)
......
...@@ -108,13 +108,13 @@ static int rfkill_gpio_probe(struct platform_device *pdev) ...@@ -108,13 +108,13 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
rfkill->clk = devm_clk_get(&pdev->dev, NULL); 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)) if (IS_ERR(gpio))
return PTR_ERR(gpio); return PTR_ERR(gpio);
rfkill->reset_gpio = 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)) if (IS_ERR(gpio))
return PTR_ERR(gpio); return PTR_ERR(gpio);
......
...@@ -1622,7 +1622,7 @@ void wiphy_work_queue(struct wiphy *wiphy, struct wiphy_work *work) ...@@ -1622,7 +1622,7 @@ void wiphy_work_queue(struct wiphy *wiphy, struct wiphy_work *work)
list_add_tail(&work->entry, &rdev->wiphy_work_list); list_add_tail(&work->entry, &rdev->wiphy_work_list);
spin_unlock_irqrestore(&rdev->wiphy_work_lock, flags); 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); EXPORT_SYMBOL_GPL(wiphy_work_queue);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment