Message ID | 20230103141054.17372-1-pkshih@realtek.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 4a0e218cc9c42d1903ade8b5a371dcf48cf918c5 |
Delegated to: | Kalle Valo |
Headers | show |
Series | wifi: rtw89: fix potential leak in rtw89_append_probe_req_ie() | expand |
Ping-Ke Shih <pkshih@realtek.com> wrote: > From: Zong-Zhe Yang <kevin_yang@realtek.com> > > Do `kfree_skb(new)` before `goto out` to prevent potential leak. > > Fixes: 895907779752 ("rtw89: 8852a: add ieee80211_ops::hw_scan") > Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com> > Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Patch applied to wireless-next.git, thanks. 4a0e218cc9c4 wifi: rtw89: fix potential leak in rtw89_append_probe_req_ie()
diff --git a/drivers/net/wireless/realtek/rtw89/fw.c b/drivers/net/wireless/realtek/rtw89/fw.c index 0328874a0d10e..466d8273bc2b1 100644 --- a/drivers/net/wireless/realtek/rtw89/fw.c +++ b/drivers/net/wireless/realtek/rtw89/fw.c @@ -2676,8 +2676,10 @@ static int rtw89_append_probe_req_ie(struct rtw89_dev *rtwdev, list_add_tail(&info->list, &scan_info->pkt_list[band]); ret = rtw89_fw_h2c_add_pkt_offload(rtwdev, &info->id, new); - if (ret) + if (ret) { + kfree_skb(new); goto out; + } kfree_skb(new); }