Skip to content

Commit

Permalink
mt76: mt7615: release mutex in mt7615_reset_test_set
Browse files Browse the repository at this point in the history
[ Upstream commit 346f810 ]

Reduce scope of mutex_acquire/mutex_release in mt7615_reset_test_set
routine in order to fix the following static checker warning:

drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c:179
mt7615_reset_test_set()
warn: inconsistent returns 'dev->mt76.mutex'.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: ea4906c ("mt76: mt7615: wake device before accessing regmap in debugfs")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
LorenzoBianconi authored and gregkh committed Oct 29, 2020
1 parent 254f44a commit 93dd7ab
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c
Expand Up @@ -165,15 +165,14 @@ mt7615_reset_test_set(void *data, u64 val)
if (!mt7615_wait_for_mcu_init(dev))
return 0;

mt7615_mutex_acquire(dev);

skb = alloc_skb(1, GFP_KERNEL);
if (!skb)
return -ENOMEM;

skb_put(skb, 1);
mt76_tx_queue_skb_raw(dev, 0, skb, 0);

mt7615_mutex_acquire(dev);
mt76_tx_queue_skb_raw(dev, 0, skb, 0);
mt7615_mutex_release(dev);

return 0;
Expand Down

0 comments on commit 93dd7ab

Please sign in to comment.