提交 f48abf06 编写于 作者: Y Yan-Hsuan Chuang 提交者: Kalle Valo

rtw88: assign NULL to skb after being kfree()'ed

Should assign NULL to skb after kfree(), in case of driver
trying to free the same skb again.

This could happen if driver failed to allocate an skb when
building reserved page.
Signed-off-by: NYan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
上级 fc83c616
......@@ -1139,13 +1139,16 @@ static u8 *rtw_build_rsvd_page(struct rtw_dev *rtwdev,
page += rtw_len_to_page(rsvd_pkt->skb->len, page_size);
kfree_skb(rsvd_pkt->skb);
rsvd_pkt->skb = NULL;
}
return buf;
release_skb:
list_for_each_entry(rsvd_pkt, &rtwdev->rsvd_page_list, list)
list_for_each_entry(rsvd_pkt, &rtwdev->rsvd_page_list, list) {
kfree_skb(rsvd_pkt->skb);
rsvd_pkt->skb = NULL;
}
return NULL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册