Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp387625pxx; Wed, 28 Oct 2020 07:15:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4pdcfwgQvtaaAg7EHqWPHxBU+v/+EGmbuxXnmneoefiBWC5SnHPvDo8EEije1d1vq+KMa X-Received: by 2002:a17:907:2677:: with SMTP id ci23mr7702908ejc.270.1603894516914; Wed, 28 Oct 2020 07:15:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603894516; cv=none; d=google.com; s=arc-20160816; b=HpAtZemIoFDkCt8nPvwp0L38GQ6Dz8AByXuHUWEzp2OyOzcYAMMecN6HvyNLPY2KAV 3wT7GAiQb7BBUmN7e7kL+SQF01q7VPNXQwBN0d665hW677RLKhxsG1TYXLO1OwAdZEkL CLmnFEJTwiXT0tOmPy0HZy89LSFyGGkBeIYpFWd+O9CUMb1/+kG+WglL6VRu+SkaHokc hi0RWVzF3KB1sFyUzKQy1SeHy4m6buTHpqqnu/mqZ7e/0v+PxYK+sFTnuBraF/kZCcOH j2JYQC1rcHYSlMQ5plKjIRXUVSX/f+aS52iW1I4I4gNEpI6vkGGJGF7JiVCp2SNUO7Ki uQhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yW1zpu0LEjeq/+MZJDx4yheaAvsfRSjlMcFPHyqZ//M=; b=JgwQXmVug44i3ATbShv1ZOX0yv+Fg9ld0b3bRyoQ4dBE0PRgHm+SS0GGLlpO6ygWS+ 4OkarSPSOuWmK5Nhe/64w/LQ6AFebSjMpjkMJW+lmCiLgBhb5h36RVfdsGkkqSZEqsg4 z9xhRyKQQ2o+9XzkJWloQP15twLNZe9IJ5KZ/bZk1mcI2Z+hQBolrEKE59kGHcnPYxB9 O0PlSqAwSvg/LkzSdBxmwDf8ovB8+4J9PZGwp/TaxD7UV33Za2SztRO5sDF1ddNsToBk 0p6+wkon8AYJcQ9FFTnBu1RhSRDwEtOK4hGeC3mE7BgoDglVWFOEpEXn2ge9YaN118PU 7u5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XoghG9Sr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z8si2802677eju.267.2020.10.28.07.14.52; Wed, 28 Oct 2020 07:15:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XoghG9Sr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1796419AbgJ0P6i (ORCPT + 99 others); Tue, 27 Oct 2020 11:58:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:54654 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757099AbgJ0PRT (ORCPT ); Tue, 27 Oct 2020 11:17:19 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8AF1222281; Tue, 27 Oct 2020 15:17:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811838; bh=w/Sna8B+cBW1cHgRCUsiscRCXsumyDFjekjoM3S3xXg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XoghG9SrkB4AiwKDjAVqN90vbbdiTLGdPhENBWwTpd1duNaIsm/rGlghLbR0QgUiI dNc0qsO+O4sdGZ/CTzuwAcqK74GYzQEJ2QbEMoBw2TQWtcMiFTVvVjnIMb6sgPpGkA lr5SkVbBx3n/ua9u6RY4GI/Ayiz7Rg014vLUK6bs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Wang Yufen , Kalle Valo , Sasha Levin Subject: [PATCH 5.8 617/633] brcm80211: fix possible memleak in brcmf_proto_msgbuf_attach Date: Tue, 27 Oct 2020 14:56:00 +0100 Message-Id: <20201027135551.771923287@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wang Yufen [ Upstream commit 6c151410d5b57e6bb0d91a735ac511459539a7bf ] When brcmf_proto_msgbuf_attach fail and msgbuf->txflow_wq != NULL, we should destroy the workqueue. Reported-by: Hulk Robot Signed-off-by: Wang Yufen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1595237765-66238-1-git-send-email-wangyufen@huawei.com Signed-off-by: Sasha Levin --- 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 8bb4f1fa790e7..1bb270e782ff2 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; -- 2.25.1