diff options
author | Daniel Drake <dsd@laptop.org> | 2012-04-16 18:53:02 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-04-17 14:57:14 -0400 |
commit | 0beecac8abb3af890d470df541142d55343382d6 (patch) | |
tree | d4916beace6595c4f5746244cd844cdaa444589c | |
parent | 370803c25dd77332ee4ca97884c3a5e1e1eafbca (diff) |
libertas: harden-up exit paths
These simple sanity check avoids extra complexity in error paths when
moving to asynchronous firmware loading (which means the device may fail to
init some time after its creation).
Signed-off-by: Daniel Drake <dsd@laptop.org>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/libertas/main.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index fa095851f214..7eaf992775ae 100644 --- a/drivers/net/wireless/libertas/main.c +++ b/drivers/net/wireless/libertas/main.c | |||
@@ -1033,7 +1033,9 @@ void lbs_remove_card(struct lbs_private *priv) | |||
1033 | lbs_deb_enter(LBS_DEB_MAIN); | 1033 | lbs_deb_enter(LBS_DEB_MAIN); |
1034 | 1034 | ||
1035 | lbs_remove_mesh(priv); | 1035 | lbs_remove_mesh(priv); |
1036 | lbs_scan_deinit(priv); | 1036 | |
1037 | if (priv->wiphy_registered) | ||
1038 | lbs_scan_deinit(priv); | ||
1037 | 1039 | ||
1038 | /* worker thread destruction blocks on the in-flight command which | 1040 | /* worker thread destruction blocks on the in-flight command which |
1039 | * should have been cleared already in lbs_stop_card(). | 1041 | * should have been cleared already in lbs_stop_card(). |
@@ -1128,6 +1130,11 @@ void lbs_stop_card(struct lbs_private *priv) | |||
1128 | goto out; | 1130 | goto out; |
1129 | dev = priv->dev; | 1131 | dev = priv->dev; |
1130 | 1132 | ||
1133 | /* If the netdev isn't registered, it means that lbs_start_card() was | ||
1134 | * never called so we have nothing to do here. */ | ||
1135 | if (dev->reg_state != NETREG_REGISTERED) | ||
1136 | goto out; | ||
1137 | |||
1131 | netif_stop_queue(dev); | 1138 | netif_stop_queue(dev); |
1132 | netif_carrier_off(dev); | 1139 | netif_carrier_off(dev); |
1133 | 1140 | ||