aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenzo Bianconi2020-07-30 11:21:31 +0200
committerFelix Fietkau2020-09-24 18:10:12 +0200
commitcddaaa56375615c256eb6960d3092ddb8a7a9154 (patch)
tree1ebcaad44595f6b83ca3029db8f3dfebf194bc37
parentd6e08f2be71092536d01a86275e1a32c4acd6684 (diff)
mt76: mt7615: hold mt76 lock queueing wd in mt7615_queue_key_update
wq queue is always updated holding mt76 spinlock. Grab mt76 lock in mt7615_queue_key_update() before putting a new element at the end of the queue. Fixes: eb99cc95c3b65 ("mt76: mt7615: introduce mt7663u support") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7615/main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/main.c b/drivers/net/wireless/mediatek/mt76/mt7615/main.c
index 2d0b1f49fdbc..bafe2bdeb5eb 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/main.c
@@ -361,7 +361,10 @@ mt7615_queue_key_update(struct mt7615_dev *dev, enum set_key_cmd cmd,
wd->key.keylen = key->keylen;
wd->key.cmd = cmd;
+ spin_lock_bh(&dev->mt76.lock);
list_add_tail(&wd->node, &dev->wd_head);
+ spin_unlock_bh(&dev->mt76.lock);
+
queue_work(dev->mt76.wq, &dev->wtbl_work);
return 0;