From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76A62C43466 for ; Fri, 18 Sep 2020 03:15:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 20AB72083B for ; Fri, 18 Sep 2020 03:15:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600398924; bh=H8WaB6BrPJvOK0/+mDoNVBymGhqmdOHaFv38C5S0Xow=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=b/NPD9wud7dkSaOZbbUxeXqdRb2eGV4YeqXH71gFRr553RxEEQk8YrLfMbf77v3d2 /6p6s6qPHbov+HQ3Fxnz3mvzFkHcH4k+i0Pkzr5cRvy6eq3lQPOKUYyBtD9qPzpKxF +XXVeF1Zo2seYn1PZJlNDjXM44vQxagIBoyWDJ8g= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730726AbgIRDPW (ORCPT ); Thu, 17 Sep 2020 23:15:22 -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: netdev@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