Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp616143pxx; Wed, 28 Oct 2020 12:29:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhykfOMpkknXeIaZ50kYBte1UNTqRF5xe8tJW5EEVic7DVwjIQzB54VY1OclkwMZ772MJL X-Received: by 2002:a17:907:4273:: with SMTP id nq3mr614715ejb.439.1603913361694; Wed, 28 Oct 2020 12:29:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603913361; cv=none; d=google.com; s=arc-20160816; b=nTjyfWPt25Xxol3HSwkpoMzkSQ1UX/EVPEqstDHC6iyEpC591xXyinXdGZDijLpmUE nIzLga5fVX9ycUIgX/sEgKcKam0Ej/j5r1HFfebjIpzQwiJDh6LhbZcjQZwcJb/YVwwt +pRNaoBiiwOtpcxrF//f6nctJpfXJEcOM7Vm28VsXxQAxioefclwx/FmfMaY8afnu/Hb hjfUXzjKwFxruNoSmgUYDJ70C3kcsDM/kW88NTaHZweML+Ce8w2Dq9I34xwZF+NXvWPm TV/7fI4BvfhyMtoF3rA9O6/g/leUNiC0sMFZPhwupKoZSGpw01LLvj6u5pA/8JYekH6m Y1zg== 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=ia78bptgy8si9J8hVVcCWkb8MMCWz3ASd9XuOESKtEs=; b=YzDItnbS2HlYvElLBt6fCcAXiATFkQ0GEEYsu2WSPyqhr+wAHtBZ8iMmEgnIJkGnBk /9FZxDhOW++XvFW20kCxKPe71PIvsw3X2av80bPEgsRgnbaFRATbtTM2v1UFiXVwomuL 6vU2zXlPBgUzU5dR7EhoyNWxHX9YMh7wdgyKSjv6c8z5eUcBkInUzxTMTFwc3OaqrGCS WSNibLHDx6/ZpzpXIZH5MBOnkyt8NCGa3cRfgdKlmgRFY1QNnAhuKFdD5TsWToe5LJYk YnapYYhQS0Aafdfzl5Z0+Kd6w2rQpLgaW36yDkU1dlzhEL+O46mrD93i1x8Y0cHex58U 5FKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=m2Gxf36H; 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 j6si24427edq.236.2020.10.28.12.28.59; Wed, 28 Oct 2020 12:29:21 -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=m2Gxf36H; 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 S1827376AbgJ0SX1 (ORCPT + 99 others); Tue, 27 Oct 2020 14:23:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:48910 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753641AbgJ0OBP (ORCPT ); Tue, 27 Oct 2020 10:01:15 -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 9855F221F8; Tue, 27 Oct 2020 14:01:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807275; bh=b0fn2WsIbPOHU2gdfv3rRmasaAVtIhOYtHllGMy7Ec4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m2Gxf36HHEn2pHc96tOBb7lqfLoPaqNxwfWbOR8seeaF/5Wy2Rl9tJQJxFMDVAQNQ bJuMqA9yPr34gVUx9K5kzzOSg6yVY1IpHlIu5tfn/tpesnfctpRCPVuK9SCYDEm/St GiM2WEjGwWxiJrt818LW8IEd9yJE0gT7uiAByDUs= 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 4.4 107/112] brcm80211: fix possible memleak in brcmf_proto_msgbuf_attach Date: Tue, 27 Oct 2020 14:50:17 +0100 Message-Id: <20201027134905.608552235@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134900.532249571@linuxfoundation.org> References: <20201027134900.532249571@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/brcm80211/brcmfmac/msgbuf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c index f944f356d9c51..cacb43573f579 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c @@ -1530,6 +1530,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