ATH10K Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ath10k: Cleanup ath10k_mac_register() error handling
@ 2015-10-08 16:15 Jeff Johnson
  2015-10-13 13:00 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Johnson @ 2015-10-08 16:15 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Jeff Johnson

The logic in the error-handling path of ath10k_mac_register() is
divergent from the logic in ath10k_mac_unregister().  Update the
ath10k_mac_register() error handling logic to align with the
ath10k_mac_unregister() logic.

Signed-off-by: Jeff Johnson <jjohnson@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/mac.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 79490ad..a37aad3c 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -7301,7 +7301,7 @@ int ath10k_mac_register(struct ath10k *ar)
 			    ath10k_reg_notifier);
 	if (ret) {
 		ath10k_err(ar, "failed to initialise regulatory: %i\n", ret);
-		goto err_free;
+		goto err_dfs_detector_exit;
 	}
 
 	ar->hw->wiphy->cipher_suites = cipher_suites;
@@ -7310,7 +7310,7 @@ int ath10k_mac_register(struct ath10k *ar)
 	ret = ieee80211_register_hw(ar->hw);
 	if (ret) {
 		ath10k_err(ar, "failed to register ieee80211: %d\n", ret);
-		goto err_free;
+		goto err_dfs_detector_exit;
 	}
 
 	if (!ath_is_world_regd(&ar->ath_common.regulatory)) {
@@ -7324,10 +7324,16 @@ int ath10k_mac_register(struct ath10k *ar)
 
 err_unregister:
 	ieee80211_unregister_hw(ar->hw);
+
+err_dfs_detector_exit:
+	if (config_enabled(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector)
+		ar->dfs_detector->exit(ar->dfs_detector);
+
 err_free:
 	kfree(ar->mac.sbands[IEEE80211_BAND_2GHZ].channels);
 	kfree(ar->mac.sbands[IEEE80211_BAND_5GHZ].channels);
 
+	SET_IEEE80211_DEV(ar->hw, NULL);
 	return ret;
 }
 
-- 
1.8.5.2


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

* Re: [PATCH] ath10k: Cleanup ath10k_mac_register() error handling
  2015-10-08 16:15 [PATCH] ath10k: Cleanup ath10k_mac_register() error handling Jeff Johnson
@ 2015-10-13 13:00 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2015-10-13 13:00 UTC (permalink / raw)
  To: Jeff Johnson; +Cc: linux-wireless, ath10k

Jeff Johnson <jjohnson@qca.qualcomm.com> writes:

> The logic in the error-handling path of ath10k_mac_register() is
> divergent from the logic in ath10k_mac_unregister().  Update the
> ath10k_mac_register() error handling logic to align with the
> ath10k_mac_unregister() logic.
>
> Signed-off-by: Jeff Johnson <jjohnson@qca.qualcomm.com>

Applied, thanks.

-- 
Kalle Valo

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

end of thread, other threads:[~2015-10-13 13:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-08 16:15 [PATCH] ath10k: Cleanup ath10k_mac_register() error handling Jeff Johnson
2015-10-13 13:00 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox