staging: r8188eu: remove unnecessary null check
authorMinghao Chi <chi.minghao@zte.com.cn>
Wed, 24 Aug 2022 08:03:50 +0000 (08:03 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Aug 2022 13:14:17 +0000 (15:14 +0200)
container_of is never null, so this null check is
unnecessary.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Link: https://lore.kernel.org/r/20220824080350.221614-1-chi.minghao@zte.com.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_mlme.c

index 26d0aa3..bb317ba 100644 (file)
@@ -1506,10 +1506,6 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv)
        pmlmepriv->pscanned = phead->next;
        while (phead != pmlmepriv->pscanned) {
                pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list);
-               if (!pnetwork) {
-                       ret = _FAIL;
-                       goto exit;
-               }
                pmlmepriv->pscanned = pmlmepriv->pscanned->next;
                rtw_check_join_candidate(pmlmepriv, &candidate, pnetwork);
        }