Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0beecac8 authored by Daniel Drake's avatar Daniel Drake Committed by John W. Linville
Browse files

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: default avatarDaniel Drake <dsd@laptop.org>
Acked-by: default avatarDan Williams <dcbw@redhat.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 370803c2
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -1033,6 +1033,8 @@ void lbs_remove_card(struct lbs_private *priv)
	lbs_deb_enter(LBS_DEB_MAIN);

	lbs_remove_mesh(priv);

	if (priv->wiphy_registered)
		lbs_scan_deinit(priv);

	/* worker thread destruction blocks on the in-flight command which
@@ -1128,6 +1130,11 @@ void lbs_stop_card(struct lbs_private *priv)
		goto out;
	dev = priv->dev;

	/* If the netdev isn't registered, it means that lbs_start_card() was
	 * never called so we have nothing to do here. */
	if (dev->reg_state != NETREG_REGISTERED)
		goto out;

	netif_stop_queue(dev);
	netif_carrier_off(dev);