[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210623191426.13648-1-paskripkin@gmail.com>
Date: Wed, 23 Jun 2021 22:14:26 +0300
From: Pavel Skripkin <paskripkin@...il.com>
To: kvalo@...eaurora.org, davem@...emloft.net, chunkeey@...il.com
Cc: ath10k@...ts.infradead.org, linux-wireless@...r.kernel.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-kernel-mentees@...ts.linuxfoundation.org,
Pavel Skripkin <paskripkin@...il.com>
Subject: [PATCH] net: ath10: add missing ret initialization
In case of not supported chip the code jump
to the error handling path, but _ret_ will be set to 0.
Returning 0 from probe means, that ->probe() succeeded, but
it's not true when chip is not supported.
Fixes: f8914a14623a ("ath10k: restore QCA9880-AR1A (v1) detection")
Signed-off-by: Pavel Skripkin <paskripkin@...il.com>
---
drivers/net/wireless/ath/ath10k/pci.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index e7fde635e0ee..36ea8debd1c7 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -3697,11 +3697,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_free_irq;
+ }
ret = ath10k_core_register(ar, &bus_params);
if (ret) {
--
2.32.0
Powered by blists - more mailing lists