fix missing error code on path err_unsupported
Subsystems (3)
cover fix missing error code on path err_unsupported
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(-)
Signature · 1 line
2.25.1
PATCH 1/2 ath10k: go to path err_unsupported when chip id is not supported
When chip id is not supported, it go to path err_unsupported to print the error message.
--- drivers/net/wireless/ath/ath10k/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/pci.c +1 -1
@@ -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) {
Signature · 1 line
2.25.1
Re: [PATCH -next 1/2] ath10k: go to path err_unsupported when chip id is not supported
Quoted 6 lines · Yang Yingliang
When chip id is not supported, it go to path
err_unsupportedto print the error message.Fixes f8914a14623a ("ath10k: restore QCA9880-AR1A (v1) detection")Signed-off-by Yang Yingliang <[email protected]>Signed-off-by Kalle Valo <[email protected]>
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()
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
PATCH 2/2 ath10k: add missing error return code in ath10k_pci_probe()
In reply to Yang YingliangWhen 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.
--- drivers/net/wireless/ath/ath10k/pci.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath10k/pci.c +9 -3
@@ -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) {
Signature · 1 line
2.25.1