netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wifi: ath12k: fix missing unwind goto in `ath12k_pci_probe`
@ 2023-04-17 11:59 Li Ningke
  2023-04-17 12:48 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Li Ningke @ 2023-04-17 11:59 UTC (permalink / raw)
  To: Kalle Valo, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Vasanthakumar Thiagarajan, Jeff Johnson,
	Karthikeyan Periyasamy, Carl Huang, P Praneesh
  Cc: hust-os-kernel-patches, Li Ningke, Dongliang Mu, Kalle Valo,
	Bhagavathi Perumal S, Baochen Qiang, Balamurugan Selvarajan,
	ath12k, linux-wireless, netdev, linux-kernel

Smatch complains that
drivers/net/wireless/ath/ath12k/pci.c:1198 ath12k_pci_probe() warn: 
missing unwind goto?

In order to release the allocated resources before returning an
error, the statement that directly returns the error is changed
to a goto statement that first releases the resources in the error
handling section.

Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
Signed-off-by: Li Ningke <lnk_01@hust.edu.cn>
Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn>
---
The issue is found by static analysis and the patch remains untested.
---
 drivers/net/wireless/ath/ath12k/pci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/ath/ath12k/pci.c
index ae7f6083c9fc..f523aa15885f 100644
--- a/drivers/net/wireless/ath/ath12k/pci.c
+++ b/drivers/net/wireless/ath/ath12k/pci.c
@@ -1195,7 +1195,8 @@ static int ath12k_pci_probe(struct pci_dev *pdev,
 			dev_err(&pdev->dev,
 				"Unknown hardware version found for QCN9274: 0x%x\n",
 				soc_hw_version_major);
-			return -EOPNOTSUPP;
+			ret = -EOPNOTSUPP;
+			goto err_pci_free_region;
 		}
 		break;
 	case WCN7850_DEVICE_ID:
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] wifi: ath12k: fix missing unwind goto in `ath12k_pci_probe`
  2023-04-17 11:59 [PATCH] wifi: ath12k: fix missing unwind goto in `ath12k_pci_probe` Li Ningke
@ 2023-04-17 12:48 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2023-04-17 12:48 UTC (permalink / raw)
  To: Li Ningke
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Vasanthakumar Thiagarajan, Jeff Johnson, Karthikeyan Periyasamy,
	Carl Huang, P Praneesh, hust-os-kernel-patches, Li Ningke,
	Dongliang Mu, Kalle Valo, Bhagavathi Perumal S, Baochen Qiang,
	Balamurugan Selvarajan, ath12k, linux-wireless, netdev,
	linux-kernel

Li Ningke <lnk_01@hust.edu.cn> wrote:

> Smatch complains that
> drivers/net/wireless/ath/ath12k/pci.c:1198 ath12k_pci_probe() warn: 
> missing unwind goto?
> 
> In order to release the allocated resources before returning an
> error, the statement that directly returns the error is changed
> to a goto statement that first releases the resources in the error
> handling section.
> 
> Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
> Signed-off-by: Li Ningke <lnk_01@hust.edu.cn>
> Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn>

Already fixed with an identical patch:

https://git.kernel.org/kvalo/ath/c/488d9a484f96

error: patch failed: drivers/net/wireless/ath/ath12k/pci.c:1195
error: drivers/net/wireless/ath/ath12k/pci.c: patch does not apply
stg import: Diff does not apply cleanly

Patch set to Rejected.

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20230417115921.176229-1-lnk_01@hust.edu.cn/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-17 12:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-17 11:59 [PATCH] wifi: ath12k: fix missing unwind goto in `ath12k_pci_probe` Li Ningke
2023-04-17 12:48 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).