wifi: rtw89: free unused skb to prevent memory leak
authorPo-Hao Huang <phhuang@realtek.com>
Fri, 16 Sep 2022 03:38:09 +0000 (11:38 +0800)
committerKalle Valo <kvalo@kernel.org>
Mon, 19 Sep 2022 10:04:44 +0000 (13:04 +0300)
This avoid potential memory leak under power saving mode.

Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220916033811.13862-6-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/core.c

index 16c7447..e3086bf 100644 (file)
@@ -847,6 +847,7 @@ int rtw89_h2c_tx(struct rtw89_dev *rtwdev,
                rtw89_debug(rtwdev, RTW89_DBG_FW,
                            "ignore h2c due to power is off with firmware state=%d\n",
                            test_bit(RTW89_FLAG_FW_RDY, rtwdev->flags));
+               dev_kfree_skb(skb);
                return 0;
        }