[PATCH] mt76: mt7915: fix memory leak in mt7915_mcu_get_rx_rate()

Shayne Chen shayne.chen at mediatek.com
Mon Nov 16 06:45:54 EST 2020


Free the skb to prevent memory leak.

Signed-off-by: Shayne Chen <shayne.chen at mediatek.com>
---
 drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
index 3e1f7ee..4776532 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
@@ -3515,5 +3515,7 @@ int mt7915_mcu_get_rx_rate(struct mt7915_phy *phy, struct ieee80211_vif *vif,
 		break;
 	}
 
+	dev_kfree_skb(skb);
+
 	return 0;
 }
-- 
2.17.1


More information about the Linux-mediatek mailing list