From patchwork Tue Sep 29 10:57:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 290795 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=-13.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, 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 C80DAC4727C for ; Tue, 29 Sep 2020 12:34:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 80D802083B for ; Tue, 29 Sep 2020 12:34:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601382874; bh=TFBY+Z38wtEk9WMdT39GZDD/7X9Gp3KLa48tdL5b0mE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=M5tWc84rLZtVSxwEPWE3ko2zGLcBaW5MBsdBmWiGam3ZPwlZROBotKTeV2NQn7zCa YT1/O5Sad8WYRO9dGwRtg+kGB/8391SyLIUvou6aTg0oUF2OjtpusIqBvWFezDmN6s pqh0HJHziBKDxVsSsJv3JFYtqI4Gs/jNyFz4V8LI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733073AbgI2MeR (ORCPT ); Tue, 29 Sep 2020 08:34:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:36424 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729672AbgI2LW5 (ORCPT ); Tue, 29 Sep 2020 07:22:57 -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 C25DC2158C; Tue, 29 Sep 2020 11:20:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601378435; bh=TFBY+Z38wtEk9WMdT39GZDD/7X9Gp3KLa48tdL5b0mE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=In5jKHQFvELdqjBDM4EdcIDT1O3EOJP/QS+4lkLiiHunhuQFh3K3hOdLd11nQp+bW ml6VyLI5i7ggGtU9z/BHneyzzJoUUO9PLp8novSCYfMyLMJ7V55O8QN5sUFyE57WlU wRmSBTYCxE5ppJk7vf+dTHmZ5yitfmPgqrc8OgCU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqing Pan , Kalle Valo , Sasha Levin Subject: [PATCH 4.19 005/245] ath10k: fix memory leak for tpc_stats_final Date: Tue, 29 Sep 2020 12:57:36 +0200 Message-Id: <20200929105947.252377992@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929105946.978650816@linuxfoundation.org> References: <20200929105946.978650816@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@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 aa333110eaba6..4e980e78ba95c 100644 --- a/drivers/net/wireless/ath/ath10k/debug.c +++ b/drivers/net/wireless/ath/ath10k/debug.c @@ -2365,6 +2365,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)