receive_uapsd: Wait for send_uapsd exit before destroying tx_thr_mutex

receive_uapsd() was destroying tx_thr_mutex without waiting for the
send_uapsd() thread to exit. This leads to tx_thr_mutex getting accessed
by uapsd_tx_stop() after the mutex is getting destroyed, resulting in a
crash "pthread_mutex_lock called on a destroyed mutex".

Address this by ensuring the receive_uapsd() thread waits for the
send_uapsd() thread to finish before destroying tx_thr_mutex.

Also remove the needless waits/joins over s->uapsd_send_thr and s->thr
in send_uapsd() and receive_uapsd(), respectively. These seemed to be
waiting on the current thread to exit.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
1 file changed