From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795023292; b=klDJ/ocDx5/q7NEyEFJM+Llxlzf5mnf+i9HVMWIXMcEoukXWMiIqVPjYddyTLKx3Ie0Y wXB0CkIyH14hfNVYZGIT8JstltCqkHPviDy1wc2ouaG1cGZhKwU1r0UZxSB1MELEcR05z mrJ/UUMU+BlXtTlvBeAVfvz/x6Bf3AbcTJ5kZr1QviK40eXXfEyDZXNuxf8RQ1yns7t8I chI1xh5No4aREuI3T2V1Pj1X++jTfmur+Gwm+JUQt57t5ig9RfvStUFdcpqN7/QywoGYZ vCyWlr/7sKRhNME4VfiwNPAqpcJGXtFEmA2hz+PINLWX34rmzjocNPak6YAWL7FE83A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795023292; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=FEBSKlu0tW0P+lxabcPSyKyRaiQd3BpnAMl12nn6G04=; b=wURKPHWRuiMGvE4f2KQ+JonmIzw1u750Fn2LNBg9crL1n1jpYWhyrMs21JUUpx/xQxmP 2+ttae6vv9XTXghwgC1FEf8ukOi9mHW7HQflcxcTzsFkfIXwjJlJl03xzlgkkozD0COcI rD+J9C0NsyklVkPCi6GpAN1jU14C5rUDIs+JqAiVPUewtGzvatIqb6pWzdFFUscyrRWZP 8Bli881xOu6SYuE0MQAbnULKClYUH4oMKx9ZrW5kMe8lKufidp6jlfTVDyPQ42SkHQWZl K2oBuirH6Nqwzz0E5XcOHLg6gl30GSFkV6g1jDtFlhpozXYdkkthrGdiIYTwVb470VQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=RzvpQsjb; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D64E606A325; Wed, 18 Nov 2026 17:34:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=RzvpQsjb Received: by smtp.kernel.org (Postfix) with ESMTPSA id 656C71F000C4; Wed, 18 Nov 2026 17:34:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795023291; bh=FEBSKlu0tW0P+lxabcPSyKyRaiQd3BpnAMl12nn6G04=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=RzvpQsjbaWULoGP6CI9zf9N8K0OsblCBfRsmL8b/VlrL6yfJXq/jRQyznnXkXXCG3 YhODaSVqW1dwuFi0jSPRN0WPKwXR/q7SR2Z0LwnH/b8Hw8zmueatSxVXVizB7wPjZ3 TC1FATCf2qk0C4WxaQ5myJOlcbonzmgn98h0MIRk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Aaradhana Sahu , Rameshkumar Sundaram , Baochen Qiang , Jeff Johnson , Sasha Levin Subject: [PATCH 6.18 0317/2151] wifi: ath12k: Free allocated CE IRQs on request_irq() failure Date: Wed, 18 Nov 2026 15:34:12 +0100 Message-ID: <20261118150133.508213926@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150121.603863898@linuxfoundation.org> References: <20261118150121.603863898@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Aaradhana Sahu [ Upstream commit 12ca935af2e68447e9218a615ebbb5ff7faf1554 ] When CE IRQ configuration fails, the driver does not release all IRQs that were successfully requested before the failure. This can leak IRQ resources during probe failure. Free the previously requested CE IRQs before returning from the error path to ensure that partially initialized IRQ resources are properly cleaned up during probe failure. Factor out the CE IRQ cleanup into a helper to reuse the cleanup logic during both error handling and driver teardown. Also free CE IRQs when external IRQ configuration fails, before returning from the error path. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.6-01243-QCAHKSWPL_SILICONZ-1 Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices") Signed-off-by: Aaradhana Sahu Reviewed-by: Rameshkumar Sundaram Reviewed-by: Baochen Qiang Link: https://patch.msgid.link/20260819110215.2485514-2-aaradhana.sahu@oss.qualcomm.com Signed-off-by: Jeff Johnson Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath12k/pci.c | 29 ++++++++++++++++++--------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/ath/ath12k/pci.c index c26c41f62feb6..e9053d160ad6c 100644 --- a/drivers/net/wireless/ath/ath12k/pci.c +++ b/drivers/net/wireless/ath/ath12k/pci.c @@ -363,6 +363,19 @@ static void ath12k_pci_sw_reset(struct ath12k_base *ab, bool power_on) ath12k_mhi_set_mhictrl_reset(ab); } +static void ath12k_pci_free_ce_irq(struct ath12k_base *ab, int num_ce) +{ + int i, irq_idx; + + for (i = 0; i < num_ce; i++) { + if (ath12k_ce_get_attr_flags(ab, i) & CE_ATTR_DIS_INTR) + continue; + + irq_idx = ATH12K_PCI_IRQ_CE0_OFFSET + i; + free_irq(ab->irq_num[irq_idx], &ab->ce.ce_pipe[i]); + } +} + static void ath12k_pci_free_ext_irq(struct ath12k_base *ab) { int i, j; @@ -380,15 +393,7 @@ static void ath12k_pci_free_ext_irq(struct ath12k_base *ab) static void ath12k_pci_free_irq(struct ath12k_base *ab) { - int i, irq_idx; - - for (i = 0; i < ab->hw_params->ce_count; i++) { - if (ath12k_ce_get_attr_flags(ab, i) & CE_ATTR_DIS_INTR) - continue; - irq_idx = ATH12K_PCI_IRQ_CE0_OFFSET + i; - free_irq(ab->irq_num[irq_idx], &ab->ce.ce_pipe[i]); - } - + ath12k_pci_free_ce_irq(ab, ab->hw_params->ce_count); ath12k_pci_free_ext_irq(ab); } @@ -711,6 +716,8 @@ static int ath12k_pci_config_irq(struct ath12k_base *ab) if (ret) { ath12k_err(ab, "failed to request irq %d: %d\n", irq_idx, ret); + + ath12k_pci_free_ce_irq(ab, i); return ret; } @@ -721,8 +728,10 @@ static int ath12k_pci_config_irq(struct ath12k_base *ab) } ret = ath12k_pci_ext_irq_config(ab); - if (ret) + if (ret) { + ath12k_pci_free_ce_irq(ab, ab->hw_params->ce_count); return ret; + } return 0; } -- 2.53.0