From 22acde23b9e98ab02f5c81189d79353a243f3ffd Mon Sep 17 00:00:00 2001 From: kimocoder Date: Sat, 6 Apr 2019 00:41:46 +0200 Subject: [PATCH] Fix alloc stainfo code --- core/rtw_sta_mgt.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/rtw_sta_mgt.c b/core/rtw_sta_mgt.c index bd4ee19..7c13002 100644 --- a/core/rtw_sta_mgt.c +++ b/core/rtw_sta_mgt.c @@ -512,9 +512,7 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, const u8 *hwaddr) /* _enter_critical_bh(&(pfree_sta_queue->lock), &irqL); */ _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL2); - if (_rtw_queue_empty(pfree_sta_queue) == _TRUE) { - /* _exit_critical_bh(&(pfree_sta_queue->lock), &irqL); */ - _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL2); + if (!pstapriv->padapter->pnetdev || _rtw_queue_empty(pfree_sta_queue) == _TRUE) { psta = NULL; } else { psta = LIST_CONTAINOR(get_next(&pfree_sta_queue->queue), struct sta_info, list);