summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorWang Yufen <wangyufen@huawei.com>2020-07-20 17:36:05 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-29 09:03:11 +0100
commitb0cc323c74a2fb8cfdfd2f4847b6459508b92991 (patch)
treeb0a100d898062b27b3b4201634b95149a81aa86b /drivers
parent52f5b7387dc017aaf54bfc64d7d4931e5467abf9 (diff)
brcm80211: fix possible memleak in brcmf_proto_msgbuf_attach
[ Upstream commit 6c151410d5b57e6bb0d91a735ac511459539a7bf ] When brcmf_proto_msgbuf_attach fail and msgbuf->txflow_wq != NULL, we should destroy the workqueue. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wang Yufen <wangyufen@huawei.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/1595237765-66238-1-git-send-email-wangyufen@huawei.com Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c
index f944f356d9c5..cacb43573f57 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c
@@ -1530,6 +1530,8 @@ fail:
BRCMF_TX_IOCTL_MAX_MSG_SIZE,
msgbuf->ioctbuf,
msgbuf->ioctbuf_handle);
+ if (msgbuf->txflow_wq)
+ destroy_workqueue(msgbuf->txflow_wq);
kfree(msgbuf);
}
return -ENOMEM;