return (struct sta_info *)(stapriv->pstainfo_buf + offset * sizeof(struct sta_info));
 }
 
-/*  this function is used to free the memory of lock || sema for all stainfos */
-static void rtw_mfree_all_stainfo(struct sta_priv *pstapriv)
-{
-       struct list_head *plist, *phead;
-       struct sta_info *psta = NULL;
-
-
-       spin_lock_bh(&pstapriv->sta_hash_lock);
-
-       phead = get_list_head(&pstapriv->free_sta_queue);
-       plist = phead->next;
-
-       while (phead != plist) {
-               psta = container_of(plist, struct sta_info, list);
-               plist = plist->next;
-       }
-
-       spin_unlock_bh(&pstapriv->sta_hash_lock);
-
-}
-
-static void rtw_mfree_sta_priv_lock(struct sta_priv *pstapriv)
-{
-        rtw_mfree_all_stainfo(pstapriv); /* be done before free sta_hash_lock */
-}
-
 u32    _rtw_free_sta_priv(struct       sta_priv *pstapriv)
 {
        struct list_head *phead, *plist;
                spin_unlock_bh(&pstapriv->sta_hash_lock);
                /*===============================*/
 
-               rtw_mfree_sta_priv_lock(pstapriv);
-
                if (pstapriv->pallocated_stainfo_buf)
                        vfree(pstapriv->pallocated_stainfo_buf);
        }