Skip to content

Commit

Permalink
at76c50x-usb: avoid mutex deadlock in at76_dwork_hw_scan
Browse files Browse the repository at this point in the history
http://bugzilla.kernel.org/show_bug.cgi?id=13312

at76_dwork_hw_scan holds a mutex while calling ieee80211_scan_completed,
which then calls at76_config which needs the same mutex.  This reworks
the ordering to not hold the lock while calling ieee80211_scan_completed.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
John W. Linville committed May 29, 2009
1 parent 4d3383d commit 21a4cc0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/net/wireless/at76c50x-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1873,18 +1873,18 @@ static void at76_dwork_hw_scan(struct work_struct *work)
if (ret != CMD_STATUS_COMPLETE) {
queue_delayed_work(priv->hw->workqueue, &priv->dwork_hw_scan,
SCAN_POLL_INTERVAL);
goto exit;
mutex_unlock(&priv->mtx);
return;
}

ieee80211_scan_completed(priv->hw, false);

if (is_valid_ether_addr(priv->bssid))
at76_join(priv);

ieee80211_wake_queues(priv->hw);

exit:
mutex_unlock(&priv->mtx);

ieee80211_scan_completed(priv->hw, false);

ieee80211_wake_queues(priv->hw);
}

static int at76_hw_scan(struct ieee80211_hw *hw,
Expand Down

0 comments on commit 21a4cc0

Please sign in to comment.