rtlwifi: Fix leak of skb when processing C2H_BT_INFO
authorLarry Finger <Larry.Finger@lwfinger.net>
Sun, 18 Nov 2018 02:55:03 +0000 (20:55 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 29 Dec 2018 12:37:58 +0000 (13:37 +0100)
commitfed44d6cb15f5e9dea806ae555dbe3b06a6c312d
tree9ad6d2bd9a075fe0e080c67d2bf4771e933f7a8c
parent5ecdfbb0d9f0f588ca6bfcb7703bc816a2b9fab5
rtlwifi: Fix leak of skb when processing C2H_BT_INFO

commit 8cfa272b0d321160ebb5b45073e39ef0a6ad73f2 upstream.

With commit 0a9f8f0a1ba9 ("rtlwifi: fix btmpinfo timeout while processing
C2H_BT_INFO"), calling rtl_c2hcmd_enqueue() with rtl_c2h_fast_cmd() true,
the routine returns without freeing that skb, thereby leaking it.

This issue has been discussed at https://github.com/lwfinger/rtlwifi_new/issues/401
and the fix tested there.

Fixes: 0a9f8f0a1ba9 ("rtlwifi: fix btmpinfo timeout while processing C2H_BT_INFO")
Reported-and-tested-by: Francisco Machado Magalhães Neto <franmagneto@gmail.com>
Cc: Francisco Machado Magalhães Neto <franmagneto@gmail.com>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: Stable <stable@vger.kernel.org> # 4.18+
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>
drivers/net/wireless/realtek/rtlwifi/base.c