From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C4D9B256C62; Thu, 17 Apr 2025 17:58:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744912729; cv=none; b=IEby+2pB4P7HvaGlfF80yPDc5fqgR6xteOJlIWPpZOme9aW7fbdalQGXUlHeREOwzKXTDEfGtTHLzGE7TEQakfFv6muQrB2HDjkyiq9mzUFpTb6ID7DgB00XrE0tsfrL19RqMnItYChGeCEouYYmZEw9V/xX2t0IcEq8SNKK28E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744912729; c=relaxed/simple; bh=+Fr6Fr4tIG2/C0v/vszZ12towaC0hJZ4IFdqz9JR0Wc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DmUa+jMGUcY8Fr78gs9E9q7lFk46js+bO8lrEVNBG9Q7tSK8pX+EB+IvwGfyoC/zCwUO4IaemQcb+sSGe8gppTPWgo4v06eId/kE45DpgrNO/WsZC/qz9E8bF2d9jgWRD9Jj14qfJVDc7aJ5Kco2gXybSA0ak9WyuY5kgGnQASU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=dC+rn/CS; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="dC+rn/CS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38D58C4CEE7; Thu, 17 Apr 2025 17:58:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1744912729; bh=+Fr6Fr4tIG2/C0v/vszZ12towaC0hJZ4IFdqz9JR0Wc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dC+rn/CSggpScaiCX1U0MNqZJtV+wsBpyYGN8wI7Iqpgu7/Y1QNr6DFtM9W///bxT 3d52QbYx10XOc8xID20IDtfeJl2eaT62W24aQcdDzvkXn+Ma7ib7uiLCSRKTtSeZX0 pCqGpu6gsm+vlSLRh7CuFEojwd53PenfuMfHRsR4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Miaoqing Pan , Aditya Kumar Singh , Jeff Johnson , Sasha Levin Subject: [PATCH 6.14 098/449] wifi: ath12k: fix memory leak in ath12k_pci_remove() Date: Thu, 17 Apr 2025 19:46:26 +0200 Message-ID: <20250417175121.906130966@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250417175117.964400335@linuxfoundation.org> References: <20250417175117.964400335@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Miaoqing Pan [ Upstream commit 1b24394ed5c8a8d8f7b9e3aa9044c31495d46f2e ] Kmemleak reported this error: unreferenced object 0xffff1c165cec3060 (size 32): comm "insmod", pid 560, jiffies 4296964570 (age 235.596s) backtrace: [<000000005434db68>] __kmem_cache_alloc_node+0x1f4/0x2c0 [<000000001203b155>] kmalloc_trace+0x40/0x88 [<0000000028adc9c8>] _request_firmware+0xb8/0x608 [<00000000cad1aef7>] firmware_request_nowarn+0x50/0x80 [<000000005011a682>] local_pci_probe+0x48/0xd0 [<00000000077cd295>] pci_device_probe+0xb4/0x200 [<0000000087184c94>] really_probe+0x150/0x2c0 The firmware memory was allocated in ath12k_pci_probe(), but not freed in ath12k_pci_remove() in case ATH12K_FLAG_QMI_FAIL bit is set. So call ath12k_fw_unmap() to free the memory. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.2.0-02280-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1 Signed-off-by: Miaoqing Pan Reviewed-by: Aditya Kumar Singh Link: https://patch.msgid.link/20250123080226.1116479-1-quic_miaoqing@quicinc.com Signed-off-by: Jeff Johnson Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath12k/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/ath/ath12k/pci.c index 2851f6944b864..ee14b84845487 100644 --- a/drivers/net/wireless/ath/ath12k/pci.c +++ b/drivers/net/wireless/ath/ath12k/pci.c @@ -1736,9 +1736,9 @@ static void ath12k_pci_remove(struct pci_dev *pdev) cancel_work_sync(&ab->reset_work); cancel_work_sync(&ab->dump_work); ath12k_core_deinit(ab); - ath12k_fw_unmap(ab); qmi_fail: + ath12k_fw_unmap(ab); ath12k_mhi_unregister(ab_pci); ath12k_pci_free_irq(ab); -- 2.39.5