Skip to content

Commit 3c260c6

Browse files
lwfingergregkh
authored andcommitted
rtlwifi: rtl8192ee: Fix memory leak when loading firmware
commit 519ce2f933fa14acf69d5c8cabcc18711943d629 upstream. In routine rtl92ee_set_fw_rsvdpagepkt(), the driver allocates an skb, but never calls rtl_cmd_send_packet(), which will free the buffer. All other rtlwifi drivers perform this operation correctly. This problem has been in the driver since it was included in the kernel. Fortunately, each firmware load only leaks 4 buffers, which likely explains why it has not previously been detected. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a8b8ab7 commit 3c260c6

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • drivers/net/wireless/realtek/rtlwifi/rtl8192ee

drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ void rtl92ee_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished)
664664
struct rtl_priv *rtlpriv = rtl_priv(hw);
665665
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
666666
struct sk_buff *skb = NULL;
667-
667+
bool rtstatus;
668668
u32 totalpacketlen;
669669
u8 u1rsvdpageloc[5] = { 0 };
670670
bool b_dlok = false;
@@ -727,7 +727,9 @@ void rtl92ee_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished)
727727
memcpy((u8 *)skb_put(skb, totalpacketlen),
728728
&reserved_page_packet, totalpacketlen);
729729

730-
b_dlok = true;
730+
rtstatus = rtl_cmd_send_packet(hw, skb);
731+
if (rtstatus)
732+
b_dlok = true;
731733

732734
if (b_dlok) {
733735
RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD ,

0 commit comments

Comments
 (0)