Commit 6c151410 authored by Wang Yufen's avatar Wang Yufen Committed by Kalle Valo
Browse files

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.

Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarWang Yufen <wangyufen@huawei.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1595237765-66238-1-git-send-email-wangyufen@huawei.com
parent 9123e3a7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1620,6 +1620,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;