wlan: check count variable while removing from list

list_empty() can still return false even if list is not initialized.
so, while removing from list use count variable to check whether
the list is empty or not.

Change-Id: I436ec6df3ef41227563d1efdb528e0444f199390
CRs-Fixed: 2679126
This commit is contained in:
Dundi Raviteja
2021-10-10 23:46:47 +02:00
committed by Francescodario Cuzzocrea
parent 4ecd853b71
commit e92fee434d
@@ -79,7 +79,7 @@ VOS_STATUS hdd_list_remove_front( hdd_list_t *pList, hdd_list_node_t **ppNode )
{
struct list_head * listptr;
if ( list_empty( &pList->anchor ) )
if (!pList->count)
{
return VOS_STATUS_E_EMPTY;
}
@@ -96,7 +96,7 @@ VOS_STATUS hdd_list_remove_back( hdd_list_t *pList, hdd_list_node_t **ppNode )
{
struct list_head * listptr;
if ( list_empty( &pList->anchor ) )
if (!pList->count)
{
return VOS_STATUS_E_EMPTY;
}