Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp177102pxx; Wed, 28 Oct 2020 01:43:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziPZeARVxNokfDhKDYGrrBEW9zd7aIQQjwos60lW2l6cmj1c+O0RUcF3nl8go5UuM9tE4Z X-Received: by 2002:a17:906:4a8d:: with SMTP id x13mr6670145eju.47.1603874584691; Wed, 28 Oct 2020 01:43:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603874584; cv=none; d=google.com; s=arc-20160816; b=BgcRa5K24isihh0l4dnWEPzPpow5z4+vFbtW3AFnpJH7le2kj/Cs7/Y5WvZj8Kvrzm qjrYvYMFytwF2oQViho7F9onifXzPcKr62xj9RcxwSdG2b4QOs6HNaGwoPUO9L8I2HUW QE1HqIsKn0E6quUuF/NkJYnYri7c/5MSsOUnICdfzmFfvaNDO8epRumcVWUBcGqsl7Ew 6hktVg8fBulNYcURJ/ew/sj+Abps5RMt8pzj1Szwsg7qoGuSMekm+SyFaxA/bk0E6RMC REpM4VxBMZbmrO6hZRA88ayAkxCRs1G/mgPbhcbavtEMXkmI+FWgJgCbMNHLYRJczjgO Hxdw== 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=cQ08N45JCJmI5DKNFj4SbkBcNXxFTGcoYkXM+ir2iZM=; b=T2HS7VTQi9ktroTwBSNIt2+eRPdJP9kNzj7QbmwfbMAJe3WNdOpncCbk133EZvZ3r5 1o6pN8BuQ6bK6Jy4Xz0zc2bUMMIdpBN3xoq1ArPplYy7xg0OD3CU0zur2mvSyyGYm7jq JuWQiUYkxKmiGtHekqy/MIpJ+PoVH7E4sdFDpolDNMk7TCOlKzh4STjHsttp+lC4JTHu WBUsErtVhayqR0kv4BLxOuKSm+bqOSic01dhc1x2JA9ZtyCwNuIS+lkmnY8wA2sGeAi+ +QKcq/BaSJI9kZ5inghuo3OZ60equqQz+0f+ooNW3eDtPW0LeJ81tV2LRndOS+guVGbm W6TA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YvY6cYpw; 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 w17si2969573ejk.629.2020.10.28.01.42.43; Wed, 28 Oct 2020 01:43:04 -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=YvY6cYpw; 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 S1755044AbgJ0OIH (ORCPT + 99 others); Tue, 27 Oct 2020 10:08:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:56856 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754975AbgJ0OHz (ORCPT ); Tue, 27 Oct 2020 10:07:55 -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 02125206D4; Tue, 27 Oct 2020 14:07:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807674; bh=lBErSqNfIc6JjwuNWgC5mTOspePfHS9GbRGVP4n6Slo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YvY6cYpwwfQJrQ/GIw+Q6WPW2Y3Yu8LprzNoykICf8jR+wa4y1CnDINi/v2hSXzcE u2fQBmeWoEV+Wyn+CJ4TCFVyuYDNWazLAfnTYLM1IlGIK3bG0Wt/ap89EH96wKlYKh 8YUZ/WzZ3Q9pUQfn4UriGOuZUqtXq7ZxtMqV1u9I= 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.9 132/139] brcm80211: fix possible memleak in brcmf_proto_msgbuf_attach Date: Tue, 27 Oct 2020 14:50:26 +0100 Message-Id: <20201027134908.419771580@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134902.130312227@linuxfoundation.org> References: <20201027134902.130312227@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 ab9f136c15937..e306e5a89dd4f 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c @@ -1540,6 +1540,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