Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1121018pxx; Tue, 27 Oct 2020 08:43:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7etbKhzS3l5hIPA64iXGhwjwYnJBrZ0uXyuc+tPIKrerkvkXqzgHduyo8O5gNgI3ZNK4l X-Received: by 2002:a17:906:eb55:: with SMTP id mc21mr2996871ejb.49.1603813429505; Tue, 27 Oct 2020 08:43:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603813429; cv=none; d=google.com; s=arc-20160816; b=kTdibA8VHaG3t5S41csLuhr4MLqEXDb5Gf8QvIoRv+0HQu6vEX9hkkrabp0YMseFWm sb7y7Uzuf2oXbdniEysDXrk80VD7LfFP0lFC6DtYVTe/4Z8Ex5R21HXKfOqJo4Gjzo8s SBrLR1S4BcfIu0JfkmJ830/Yc7pGir/sVg2sONnvPy6ThyQmpBF4OEFM20xnxudRw/CQ ZwnCRgQELcqmxekwn3mKlYdFNtVZDiN9mR3WxKljlwmJPa1hV0eHoHJieQ4dQbyHHmnk REDPTwItPaacFNn7MNHPhE6r5cWp73R0EqwhZTLW74GB37sCxO3D6CSOnyK6orqGCLmW ff4A== 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=WgxQe5HnkgfnLLsFXwIQq5gP7tpFD8efcWkwkdqffTQ=; b=OasW4rJ0YNCPQSp8HIOhXI4e5dQ2j+NZuxKk7XRSeThptKqz2PrzB30eiXD57i0K9Z UhtLV11xDr1XibDgwhjgoZ+gW/wo0/DlFEDzSEZhyEA5OusF01ZgQrKabJNXP765l3U6 zx4TCtSSnp0j5+m5HhB0FDvYtjdoaROtNrDlBE2oHFexyZQWDk0t7KuhBw0VkMNybU1j J1i7euuZEgk+RJW9ThaHTo7D8vV6DeMBThWctWmvjaaGFenOSpwSHaThKMxdmDg5FWiR h+FNb+XjItD0HH1ovvgwmqu8y5taNPrnK/XHdVzLntFNDv0pQ/9e+QfTNDRgYomh6kQF FbsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="N/n5Defq"; 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 lg14si1196796ejb.82.2020.10.27.08.43.25; Tue, 27 Oct 2020 08:43:49 -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="N/n5Defq"; 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 S1751324AbgJ0Oqk (ORCPT + 99 others); Tue, 27 Oct 2020 10:46:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:46534 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1764219AbgJ0Oqj (ORCPT ); Tue, 27 Oct 2020 10:46:39 -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 E5A2422258; Tue, 27 Oct 2020 14:46:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809998; bh=unK3KpYy1Ml2lpFoNEJmYdq8PZYAjPcfXRHIKaQp7X8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N/n5DefqGbv4qjfdLIcBcO8mmrWyIbaBTfbEmOCbTGTA7Tv48FbM6dat3s9GB1vgl +EPCQWj9kbnAekD9XnKiiAmm136WJSiRGqQq0O7HL2hqcOGMCSpO35e7d6BkUGIIy3 ph02Pcj0AInH6c1Ej+X2n0ctMcfoAXSLqvg+5kjE= 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.4 394/408] brcm80211: fix possible memleak in brcmf_proto_msgbuf_attach Date: Tue, 27 Oct 2020 14:55:32 +0100 Message-Id: <20201027135513.261825554@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@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 e3dd8623be4ec..c2705d7a4247e 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