All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next 0/2] fix missing error code on path err_unsupported
@ 2021-05-22 10:58 Yang Yingliang
  2021-05-22 10:58 ` [PATCH -next 1/2] ath10k: go to path err_unsupported when chip id is not supported Yang Yingliang
  2021-05-22 10:58 ` [PATCH -next 2/2] ath10k: add missing error return code in ath10k_pci_probe() Yang Yingliang
  0 siblings, 2 replies; 4+ messages in thread
From: Yang Yingliang @ 2021-05-22 10:58 UTC (permalink / raw)
  To: linux-kernel, netdev, linux-wireless; +Cc: kvalo

Yang Yingliang (2):
  ath10k: go to path err_unsupported when chip id is not supported
  ath10k: add missing error return code in ath10k_pci_probe()

 drivers/net/wireless/ath/ath10k/pci.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

-- 
2.25.1


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

* [PATCH -next 1/2] ath10k: go to path err_unsupported when chip id is not supported
  2021-05-22 10:58 [PATCH -next 0/2] fix missing error code on path err_unsupported Yang Yingliang
@ 2021-05-22 10:58 ` Yang Yingliang
  2021-06-12 10:34   ` Kalle Valo
  2021-05-22 10:58 ` [PATCH -next 2/2] ath10k: add missing error return code in ath10k_pci_probe() Yang Yingliang
  1 sibling, 1 reply; 4+ messages in thread
From: Yang Yingliang @ 2021-05-22 10:58 UTC (permalink / raw)
  To: linux-kernel, netdev, linux-wireless; +Cc: kvalo

When chip id is not supported, it go to path err_unsupported
to print the error message.

Fixes: f8914a14623a ("ath10k: restore QCA9880-AR1A (v1) detection")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/net/wireless/ath/ath10k/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index e7fde635e0ee..463cf3f8f8a5 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -3701,7 +3701,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
 		goto err_unsupported;
 
 	if (!ath10k_pci_chip_is_supported(pdev->device, bus_params.chip_id))
-		goto err_free_irq;
+		goto err_unsupported;
 
 	ret = ath10k_core_register(ar, &bus_params);
 	if (ret) {
-- 
2.25.1


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

* [PATCH -next 2/2] ath10k: add missing error return code in ath10k_pci_probe()
  2021-05-22 10:58 [PATCH -next 0/2] fix missing error code on path err_unsupported Yang Yingliang
  2021-05-22 10:58 ` [PATCH -next 1/2] ath10k: go to path err_unsupported when chip id is not supported Yang Yingliang
@ 2021-05-22 10:58 ` Yang Yingliang
  1 sibling, 0 replies; 4+ messages in thread
From: Yang Yingliang @ 2021-05-22 10:58 UTC (permalink / raw)
  To: linux-kernel, netdev, linux-wireless; +Cc: kvalo

When chip_id is not supported, the resources will be freed
on path err_unsupported, these resources will also be freed
when calling ath10k_pci_remove(), it will cause double free,
so return -ENODEV when it doesn't support the device with wrong
chip_id.

Fixes: c0c378f9907c ("ath10k: remove target soc ps code")
Fixes: 7505f7c3ec1d ("ath10k: create a chip revision whitelist")
Fixes: f8914a14623a ("ath10k: restore QCA9880-AR1A (v1) detection")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/net/wireless/ath/ath10k/pci.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 463cf3f8f8a5..71878ab35b93 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -3685,8 +3685,10 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
 			ath10k_pci_soc_read32(ar, SOC_CHIP_ID_ADDRESS);
 		if (bus_params.chip_id != 0xffffffff) {
 			if (!ath10k_pci_chip_is_supported(pdev->device,
-							  bus_params.chip_id))
+							  bus_params.chip_id)) {
+				ret = -ENODEV;
 				goto err_unsupported;
+			}
 		}
 	}
 
@@ -3697,11 +3699,15 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
 	}
 
 	bus_params.chip_id = ath10k_pci_soc_read32(ar, SOC_CHIP_ID_ADDRESS);
-	if (bus_params.chip_id == 0xffffffff)
+	if (bus_params.chip_id == 0xffffffff) {
+		ret = -ENODEV;
 		goto err_unsupported;
+	}
 
-	if (!ath10k_pci_chip_is_supported(pdev->device, bus_params.chip_id))
+	if (!ath10k_pci_chip_is_supported(pdev->device, bus_params.chip_id)) {
+		ret = -ENODEV;
 		goto err_unsupported;
+	}
 
 	ret = ath10k_core_register(ar, &bus_params);
 	if (ret) {
-- 
2.25.1


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

* Re: [PATCH -next 1/2] ath10k: go to path err_unsupported when chip id is not supported
  2021-05-22 10:58 ` [PATCH -next 1/2] ath10k: go to path err_unsupported when chip id is not supported Yang Yingliang
@ 2021-06-12 10:34   ` Kalle Valo
  0 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2021-06-12 10:34 UTC (permalink / raw)
  To: Yang Yingliang; +Cc: linux-kernel, netdev, linux-wireless

Yang Yingliang <yangyingliang@huawei.com> wrote:

> When chip id is not supported, it go to path err_unsupported
> to print the error message.
> 
> Fixes: f8914a14623a ("ath10k: restore QCA9880-AR1A (v1) detection")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

2 patches applied to ath-next branch of ath.git, thanks.

9e88dd431d23 ath10k: go to path err_unsupported when chip id is not supported
e2783e2f39ba ath10k: add missing error return code in ath10k_pci_probe()

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20210522105822.1091848-2-yangyingliang@huawei.com/

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


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

end of thread, other threads:[~2021-06-12 10:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-22 10:58 [PATCH -next 0/2] fix missing error code on path err_unsupported Yang Yingliang
2021-05-22 10:58 ` [PATCH -next 1/2] ath10k: go to path err_unsupported when chip id is not supported Yang Yingliang
2021-06-12 10:34   ` Kalle Valo
2021-05-22 10:58 ` [PATCH -next 2/2] ath10k: add missing error return code in ath10k_pci_probe() Yang Yingliang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.