summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@163.com>2016-03-01 18:22:23 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-03-12 09:09:09 +0300
commit400a30dd991bd9aa16cd6f77e163bf96314f9262 (patch)
treeedffaae37a71a532000f0a59235f58e4059aaae4
parentc15cc49810fe2547cbf3ac58f6939f0f69a6c1c5 (diff)
downloadlinux-400a30dd991bd9aa16cd6f77e163bf96314f9262.tar.xz
staging: rtl8723au: fix static checker warning
Fix the following static checker warning: drivers/staging/rtl8723au/core/rtw_sta_mgt.c:365 rtw_get_stainfo23a() error: potential NULL dereference 'psta'. Fixes: e280d71("staging: rtl8723au: use list_for_each_entry*()") Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/rtl8723au/core/rtw_sta_mgt.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/staging/rtl8723au/core/rtw_sta_mgt.c b/drivers/staging/rtl8723au/core/rtw_sta_mgt.c
index 22d857b6e8d0..5f85ee065779 100644
--- a/drivers/staging/rtl8723au/core/rtw_sta_mgt.c
+++ b/drivers/staging/rtl8723au/core/rtw_sta_mgt.c
@@ -346,7 +346,7 @@ void rtw_free_all_stainfo23a(struct rtw_adapter *padapter)
struct sta_info *rtw_get_stainfo23a(struct sta_priv *pstapriv, const u8 *hwaddr)
{
struct list_head *phead;
- struct sta_info *psta = NULL;
+ struct sta_info *pos, *psta = NULL;
u32 index;
const u8 *addr;
@@ -362,7 +362,9 @@ struct sta_info *rtw_get_stainfo23a(struct sta_priv *pstapriv, const u8 *hwaddr)
spin_lock_bh(&pstapriv->sta_hash_lock);
phead = &pstapriv->sta_hash[index];
- list_for_each_entry(psta, phead, hash_list) {
+ list_for_each_entry(pos, phead, hash_list) {
+ psta = pos;
+
/* if found the matched address */
if (ether_addr_equal(psta->hwaddr, addr))
break;