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

Commit 8c7f4f31 authored by Juuso Oikarinen's avatar Juuso Oikarinen Committed by Luciano Coelho
Browse files

wl1271: Fix work cancelling when shutting down the driver



The work cancelling has had several hazards, ranging from potentially
executing work after the driver is in OFF state, to executing work after
the driver and relevant memory structures are already removed.

Fix these.

Signed-off-by: default avatarJuuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: default avatarTeemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
Signed-off-by: default avatarLuciano Coelho <luciano.coelho@nokia.com>
parent c454f1d9
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -41,6 +41,9 @@ void wl1271_pspoll_work(struct work_struct *work)

	mutex_lock(&wl->mutex);

	if (unlikely(wl->state == WL1271_STATE_OFF))
		goto out;

	if (!test_and_clear_bit(WL1271_FLAG_PSPOLL_FAILURE, &wl->flags))
		goto out;

+3 −0
Original line number Diff line number Diff line
@@ -792,6 +792,8 @@ int wl1271_plt_stop(struct wl1271 *wl)
out:
	mutex_unlock(&wl->mutex);

	cancel_work_sync(&wl->irq_work);

	return ret;
}

@@ -995,6 +997,7 @@ static void wl1271_op_remove_interface(struct ieee80211_hw *hw,
	cancel_work_sync(&wl->irq_work);
	cancel_work_sync(&wl->tx_work);
	cancel_delayed_work_sync(&wl->pspoll_work);
	cancel_delayed_work_sync(&wl->elp_work);

	mutex_lock(&wl->mutex);

+3 −0
Original line number Diff line number Diff line
@@ -39,6 +39,9 @@ void wl1271_elp_work(struct work_struct *work)

	mutex_lock(&wl->mutex);

	if (unlikely(wl->state == WL1271_STATE_OFF))
		goto out;

	if (test_bit(WL1271_FLAG_IN_ELP, &wl->flags) ||
	    (!test_bit(WL1271_FLAG_PSM, &wl->flags) &&
	     !test_bit(WL1271_FLAG_IDLE, &wl->flags)))