Skip to contentSkip to conversation

wifi: ath12k: fix error unwind on arch_init() failure in PCI probe

PATCH Applied Ripan Deuri 4 participants 4 messages May 19 – May 26 Qualcomm ATH12K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: ath12k: fix error unwind on arch_init() failure in PCI probe

From: Ripan Deuri <[email protected]>

When arch_init() fails in ath12k_pci_probe(), the code jumps to err_pci_msi_free, leaking resources in teardown.

Redirect the failure path to err_free_irq so teardown matches the setup order.

Compile-tested only.

Fixes 614c23e24ee8 ("wifi: ath12k: Support arch-specific DP device allocation")
---
 drivers/net/wireless/ath/ath12k/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath12k/pci.c +1 -1
index 375277ca2b89..d9a22d6afbb0 100644
@@ -1639,7 +1639,7 @@ static int ath12k_pci_probe(struct pci_dev *pdev,
 	ret = ab_pci->device_family_ops->arch_init(ab);
 	if (ret) {
 		ath12k_err(ab, "PCI arch_init failed %d\n", ret);
-		goto err_pci_msi_free;
+		goto err_free_irq;
 	}
 
 	ret = ath12k_core_init(ab);

base-commit: 7b25796f571fc09a7aa6fe7efb23edccd326917d

Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Ripan Deuri

From: Ripan Deuri <[email protected]>

When arch_init() fails in ath12k_pci_probe(), the code jumps to err_pci_msi_free, leaking resources in teardown.

Redirect the failure path to err_free_irq so teardown matches the setup order.

Compile-tested only.

Fixes 614c23e24ee8 ("wifi: ath12k: Support arch-specific DP device allocation")
Reviewed-by on v1 1/1
#2 lore raw
In reply to Ripan Deuri
Quoted 11 lines · Ripan Deuri

From: Ripan Deuri <[email protected]>

When arch_init() fails in ath12k_pci_probe(), the code jumps to err_pci_msi_free, leaking resources in teardown.

Redirect the failure path to err_free_irq so teardown matches the setup order.

Compile-tested only.

Fixes 614c23e24ee8 ("wifi: ath12k: Support arch-specific DP device allocation")
Applied
#3 lore raw
In reply to Ripan Deuri
Quoted 8 lines · Ripan Deuri

When arch_init() fails in ath12k_pci_probe(), the code jumps to err_pci_msi_free, leaking resources in teardown.

Redirect the failure path to err_free_irq so teardown matches the setup order.

Compile-tested only.

[...]

Applied, thanks!

[1/1] wifi: ath12k: fix error unwind on arch_init() failure in PCI probe

      commit: d5c336161088c588f85da64f48ba6deead194afd

Best regards,

Signature · 1 line
Jeff Johnson <[email protected]>