Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4b084d27 authored by Dundi Raviteja's avatar Dundi Raviteja
Browse files

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
parent e202ef05
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -79,7 +79,7 @@ VOS_STATUS hdd_list_remove_front( hdd_list_t *pList, hdd_list_node_t **ppNode )
{
{
   struct list_head * listptr;
   struct list_head * listptr;


   if ( list_empty( &pList->anchor ) )
   if (!pList->count)
   {
   {
      return VOS_STATUS_E_EMPTY;
      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;
   struct list_head * listptr;


   if ( list_empty( &pList->anchor ) )
   if (!pList->count)
   {
   {
      return VOS_STATUS_E_EMPTY;
      return VOS_STATUS_E_EMPTY;
   }
   }