summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCihangir Akturk <cakturk@gmail.com>2016-03-04 16:43:10 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-03-12 09:09:09 +0300
commitd31770b32fb40f6087ca9ae7139fedd0d0a27771 (patch)
tree4175ef2f599afbecff64115a5b867b70f6b9f120
parent67ea154073bc3ecfdce58654b103363420ac9403 (diff)
downloadlinux-d31770b32fb40f6087ca9ae7139fedd0d0a27771.tar.xz
drivers: staging: rtl8723au: remove unneeded null test
null test on pnetwork removed, because the iterator variable list_for_each_entry_safe cannot be null. This commit fixes the following error reported by coccinelle: drivers/staging/rtl8723au/core/rtw_mlme.c:1621:7-15: ERROR: iterator variable bound on line 1620 cannot be NULL Signed-off-by: Cihangir Akturk <cakturk@gmail.com> Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/rtl8723au/core/rtw_mlme.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c
index 3adda555becb..a786fc4bdb53 100644
--- a/drivers/staging/rtl8723au/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723au/core/rtw_mlme.c
@@ -1617,19 +1617,10 @@ rtw_select_candidate_from_queue(struct mlme_priv *pmlmepriv)
spin_lock_bh(&pmlmepriv->scanned_queue.lock);
phead = get_list_head(queue);
- list_for_each_entry_safe(pnetwork, ptmp, phead, list) {
- if (!pnetwork) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_,
- "%s: return _FAIL:(pnetwork == NULL)\n",
- __func__);
- goto exit;
- }
-
+ list_for_each_entry_safe(pnetwork, ptmp, phead, list)
rtw_check_join_candidate(pmlmepriv, &candidate, pnetwork);
- }
-
-exit:
spin_unlock_bh(&pmlmepriv->scanned_queue.lock);
+
return candidate;
}