From d532a1ebc55db29c04a651b6d5b9b3eacd718db7 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Wed, 25 Oct 2017 14:11:25 -0500 Subject: [PATCH] rtl8723ds: Fix another context imbalance and some big-endian errors Signed-off-by: Larry Finger --- core/rtw_sta_mgt.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/core/rtw_sta_mgt.c b/core/rtw_sta_mgt.c index f931724..ecbe153 100644 --- a/core/rtw_sta_mgt.c +++ b/core/rtw_sta_mgt.c @@ -21,14 +21,14 @@ #include -bool test_st_match_rule(_adapter *adapter, u8 *local_naddr, u8 *local_port, u8 *remote_naddr, u8 *remote_port) +static bool test_st_match_rule(_adapter *adapter, u8 *local_naddr, u8 *local_port, u8 *remote_naddr, u8 *remote_port) { - if (ntohs(*((u16 *)local_port)) == 5001 || ntohs(*((u16 *)remote_port)) == 5001) + if (ntohs(*((__be16 *)local_port)) == 5001 || ntohs(*((__be16 *)remote_port)) == 5001) return _TRUE; return _FALSE; } -struct st_register test_st_reg = { +static struct st_register test_st_reg = { .s_proto = 0x06, .rule = test_st_match_rule, }; @@ -448,19 +448,15 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) pfree_sta_queue = &pstapriv->free_sta_queue; - /* _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); - psta = NULL; + return NULL; } else { psta = LIST_CONTAINOR(get_next(&pfree_sta_queue->queue), struct sta_info, list); rtw_list_delete(&(psta->list)); - /* _exit_critical_bh(&(pfree_sta_queue->lock), &irqL); */ - tmp_aid = psta->aid; _rtw_init_stainfo(psta);