Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp883461pxk; Thu, 17 Sep 2020 20:16:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLN/dKm6Hf4B9DRv+2hk2/vpELatpWeplgpIFmGjRWkGVIGCGE7UHNRU2jzZZ+v4qyDvxW X-Received: by 2002:a17:906:fb97:: with SMTP id lr23mr34491089ejb.257.1600398999086; Thu, 17 Sep 2020 20:16:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600398999; cv=none; d=google.com; s=arc-20160816; b=ubC54Ws6cgWhNKNfbJyRBzCeG63NGqI5C/jDpJTfbJc593padEvYEDyt3lOdPxzuac RVLAQzV/XtZspO4xE9vALjcXlJ91g65iIsYyxplSJAMqd/QkXMDnu86Atw6FluPW96Gc +cPacwXcV9ris3vqua4w03X28SkwPeL3/scPfImOP9B/AuIbSU02YCS2sp5SpQBIwr8u 6eBYnwAPL8wKeT8SHDgbvYgJx1zuYf+i/4gMaIToot3a9NpOkqGS4Ym/+4J+CSXrE9fW sspbU+Eh6t9KQWCxuzzWR8hASv9fSL+ot6vwok/b9ROxK1cZMqHi1CzyHjdmYu0beuoP Lj0g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tm8M//Kys7fkMkW/qhSq0ayCNkyODh1zAaH+TFsg+ho=; b=jFTpNfpoUp1zOcJiBKk+c9u/EDeonncXAuMJSsFZvpG7007sOMQk0gpEcaEo/Yu5wz UU9YZA41NjcLEeMOuTfEycyAUCtRZT5Ly/GSR1myZGHCcRKll5nCT0xSd8e3Evx55glS kMIKPQdWrw/ziYC3a3yc1woieheni24+Z9Cm+fHbRl3VRqFa3ZEOu+7KMxmVZV1GRAjL f9/aFIlCMNxjKaLy6Bvt3JzqdvmG7qn4bnC9B0ZWleAY1kycjJKSIgXUt7Gi9k4dym3s ejo+dkpVDXhBIQ2V3AfvgzeYe9fgSftF9onW7qrzHox+rJMLAtoSac+VZf1j495EyaJl PnoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fzCm7hv8; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n20si1218528eda.406.2020.09.17.20.16.16; Thu, 17 Sep 2020 20:16:39 -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=fzCm7hv8; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730721AbgIRDPY (ORCPT + 99 others); Thu, 17 Sep 2020 23:15:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:45804 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726370AbgIRCB3 (ORCPT ); Thu, 17 Sep 2020 22:01:29 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8C8AF21D40; Fri, 18 Sep 2020 02:01:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394486; bh=H8WaB6BrPJvOK0/+mDoNVBymGhqmdOHaFv38C5S0Xow=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fzCm7hv8XcKg1CxHjHJSHazN685HAqZZvNrpSg74aL9ffiCCJWFi1FMk+/srpwrN1 ASDK2F0K2/niRsWPN9FLrlyjCvXnEFawAygmDwaUKI3V3cUZWrYcs9jjx0sjX5aP1L HsmeLbQPM21wzaiDTbj9PEnFB9ixkM6+LSLsdDhE= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Miaoqing Pan , Kalle Valo , Sasha Levin , ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 012/330] ath10k: fix memory leak for tpc_stats_final Date: Thu, 17 Sep 2020 21:55:52 -0400 Message-Id: <20200918020110.2063155-12-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> References: <20200918020110.2063155-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miaoqing Pan [ Upstream commit 486a8849843455298d49e694cca9968336ce2327 ] The memory of ar->debug.tpc_stats_final is reallocated every debugfs reading, it should be freed in ath10k_debug_destroy() for the last allocation. Tested HW: QCA9984 Tested FW: 10.4-3.9.0.2-00035 Signed-off-by: Miaoqing Pan Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath10k/debug.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c index 40baf25ac99f3..04c50a26a4f47 100644 --- a/drivers/net/wireless/ath/ath10k/debug.c +++ b/drivers/net/wireless/ath/ath10k/debug.c @@ -2532,6 +2532,7 @@ void ath10k_debug_destroy(struct ath10k *ar) ath10k_debug_fw_stats_reset(ar); kfree(ar->debug.tpc_stats); + kfree(ar->debug.tpc_stats_final); } int ath10k_debug_register(struct ath10k *ar) -- 2.25.1