summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/wil6210/pcie_bus.c
diff options
context:
space:
mode:
authorDedy Lansky <qca_dlansky@qca.qualcomm.com>2017-06-16 10:38:03 +0300
committerKalle Valo <kvalo@qca.qualcomm.com>2017-06-21 16:18:42 +0300
commit5b49ee9f13c7c3079117fc07ee603656c809e6c2 (patch)
tree7915db4a4c792b192cb7c5f1352848219492e01d /drivers/net/wireless/ath/wil6210/pcie_bus.c
parent6824834946a61cdbb1d7e4102c3931785b4ce733 (diff)
downloadtalos-op-linux-5b49ee9f13c7c3079117fc07ee603656c809e6c2.tar.gz
talos-op-linux-5b49ee9f13c7c3079117fc07ee603656c809e6c2.zip
wil6210: prevent platform callbacks after uninit
After calling platform_ops.uninit() it is still possible to invoke platform callbacks. To prevent this, zero platform_ops right after invoking uninit. Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com> Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/wil6210/pcie_bus.c')
-rw-r--r--drivers/net/wireless/ath/wil6210/pcie_bus.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/wil6210/pcie_bus.c b/drivers/net/wireless/ath/wil6210/pcie_bus.c
index bf9f26563c48..a874d8dfa198 100644
--- a/drivers/net/wireless/ath/wil6210/pcie_bus.c
+++ b/drivers/net/wireless/ath/wil6210/pcie_bus.c
@@ -191,6 +191,13 @@ static int wil_platform_rop_fw_recovery(void *wil_handle)
return 0;
}
+static void wil_platform_ops_uninit(struct wil6210_priv *wil)
+{
+ if (wil->platform_ops.uninit)
+ wil->platform_ops.uninit(wil->platform_handle);
+ memset(&wil->platform_ops, 0, sizeof(wil->platform_ops));
+}
+
static int wil_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{
struct wil6210_priv *wil;
@@ -327,8 +334,7 @@ err_release_reg:
err_disable_pdev:
pci_disable_device(pdev);
err_plat:
- if (wil->platform_ops.uninit)
- wil->platform_ops.uninit(wil->platform_handle);
+ wil_platform_ops_uninit(wil);
if_free:
wil_if_free(wil);
@@ -357,8 +363,7 @@ static void wil_pcie_remove(struct pci_dev *pdev)
pci_iounmap(pdev, csr);
pci_release_region(pdev, 0);
pci_disable_device(pdev);
- if (wil->platform_ops.uninit)
- wil->platform_ops.uninit(wil->platform_handle);
+ wil_platform_ops_uninit(wil);
wil_if_free(wil);
}
OpenPOWER on IntegriCloud