diff options
author | Navid Emamdoost <navid.emamdoost@gmail.com> | 2020-07-18 07:26:29 +0200 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2020-08-02 17:11:34 +0200 |
commit | 880e21490be68ef9cc8185962e9b5722a0f1fc4d (patch) | |
tree | 06fc85179f278115c9a9ae0c3e718c0e763fb35e | |
parent | iwlwifi: yoyo: don't print failure if debug firmware is missing (diff) | |
download | linux-880e21490be68ef9cc8185962e9b5722a0f1fc4d.tar.xz linux-880e21490be68ef9cc8185962e9b5722a0f1fc4d.zip |
mt7601u: add missing release on skb in mt7601u_mcu_msg_send
In the implementation of mt7601u_mcu_msg_send(), skb is supposed to be
consumed on all execution paths. Release skb before returning if
test_bit() fails.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Acked-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200718052630.11032-1-navid.emamdoost@gmail.com
-rw-r--r-- | drivers/net/wireless/mediatek/mt7601u/mcu.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt7601u/mcu.c b/drivers/net/wireless/mediatek/mt7601u/mcu.c index af55ed82b96f..1b5cc271a9e1 100644 --- a/drivers/net/wireless/mediatek/mt7601u/mcu.c +++ b/drivers/net/wireless/mediatek/mt7601u/mcu.c @@ -116,8 +116,10 @@ mt7601u_mcu_msg_send(struct mt7601u_dev *dev, struct sk_buff *skb, int sent, ret; u8 seq = 0; - if (test_bit(MT7601U_STATE_REMOVED, &dev->state)) + if (test_bit(MT7601U_STATE_REMOVED, &dev->state)) { + consume_skb(skb); return 0; + } mutex_lock(&dev->mcu.mutex); |