rtw88: plug various skb leaks in error cases
Based on manual inspection the skbs are not freed in those unlikely cases, though all would give an error message so would have gone noticed if happened. While here fix a typo in one of these error messages. MFC after: 3 days
This commit is contained in:
parent
dbc06dd98a
commit
728afa885f
@ -1825,6 +1825,9 @@ static int _rtw_hw_scan_update_probe_req(struct rtw_dev *rtwdev, u8 num_ssids,
|
||||
skb_unlink(skb, probe_req_list);
|
||||
rtw_fill_rsvd_page_desc(rtwdev, skb, RSVD_PROBE_REQ);
|
||||
if (skb->len > page_size * RTW_PROBE_PG_CNT) {
|
||||
#if defined(__FreeBSD__)
|
||||
kfree_skb(skb);
|
||||
#endif
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
@ -965,6 +965,9 @@ static int rtw_pci_write_data_rsvd_page(struct rtw_dev *rtwdev, u8 *buf,
|
||||
|
||||
ret = rtw_pci_tx_write_data(rtwdev, &pkt_info, skb, RTW_TX_QUEUE_BCN);
|
||||
if (ret) {
|
||||
#if defined(__FreeBSD__)
|
||||
dev_kfree_skb_any(skb);
|
||||
#endif
|
||||
rtw_err(rtwdev, "failed to write rsvd page data\n");
|
||||
return ret;
|
||||
}
|
||||
@ -989,6 +992,9 @@ static int rtw_pci_write_data_h2c(struct rtw_dev *rtwdev, u8 *buf, u32 size)
|
||||
|
||||
ret = rtw_pci_tx_write_data(rtwdev, &pkt_info, skb, RTW_TX_QUEUE_H2C);
|
||||
if (ret) {
|
||||
#if defined(__FreeBSD__)
|
||||
dev_kfree_skb_any(skb);
|
||||
#endif
|
||||
rtw_err(rtwdev, "failed to write h2c data\n");
|
||||
return ret;
|
||||
}
|
||||
|
@ -638,7 +638,12 @@ static void rtw_txq_push(struct rtw_dev *rtwdev,
|
||||
|
||||
ret = rtw_txq_push_skb(rtwdev, rtwtxq, skb);
|
||||
if (ret) {
|
||||
#if defined(__FreeBSD__)
|
||||
dev_kfree_skb_any(skb);
|
||||
rtw_err(rtwdev, "failed to push skb, ret %d\n", ret);
|
||||
#else
|
||||
rtw_err(rtwdev, "failed to pusk skb, ret %d\n", ret);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user