[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1595237765-66238-1-git-send-email-wangyufen@huawei.com>
Date: Mon, 20 Jul 2020 17:36:05 +0800
From: Wang Yufen <wangyufen@...wei.com>
To: <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<brcm80211-dev-list@...ress.com>, <linux-wireless@...r.kernel.org>,
<davem@...emloft.net>, <kvalo@...eaurora.org>, <kuba@...nel.org>,
<franky.lin@...adcom.com>, <wright.feng@...ress.com>
CC: Wang Yufen <wangyufen@...wei.com>
Subject: [PATCH net-next] brcm80211: fix possible memleak in brcmf_proto_msgbuf_attach
When brcmf_proto_msgbuf_attach fail and msgbuf->txflow_wq != NULL,
we should destroy the workqueue.
Fixes: 05491d2ccf20 ("brcm80211: move under broadcom vendor directory")
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Wang Yufen <wangyufen@...wei.com>
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
index 8bb4f1f..1bb270e 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
@@ -1619,6 +1619,8 @@ int brcmf_proto_msgbuf_attach(struct brcmf_pub *drvr)
BRCMF_TX_IOCTL_MAX_MSG_SIZE,
msgbuf->ioctbuf,
msgbuf->ioctbuf_handle);
+ if (msgbuf->txflow_wq)
+ destroy_workqueue(msgbuf->txflow_wq);
kfree(msgbuf);
}
return -ENOMEM;
--
1.8.3
Powered by blists - more mailing lists