re: staging: rtl8723au: use list_for_each_entry*()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Geliang Tang,

The patch e280d71bea18: "staging: rtl8723au: use
list_for_each_entry*()" from Feb 18, 2016, leads to the following
static checker warning:

	drivers/staging/rtl8723au/core/rtw_sta_mgt.c:365 rtw_get_stainfo23a()
	error: potential NULL dereference 'psta'.

drivers/staging/rtl8723au/core/rtw_sta_mgt.c
   363          spin_lock_bh(&pstapriv->sta_hash_lock);
   364          phead = &pstapriv->sta_hash[index];
   365          list_for_each_entry(psta, phead, hash_list) {
   366                  /*  if found the matched address */
   367                  if (ether_addr_equal(psta->hwaddr, addr))
   368                          break;
   369  
   370                  psta = NULL;
                        ^^^^^^^^^^^
This leads to a NULL dereference if we don't the address is not first
in the list.

   371          }
   372          spin_unlock_bh(&pstapriv->sta_hash_lock);
   373          return psta;
   374  }

regards,
dan carpenter
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux