From: Himadri Pandya Date: Wed, 3 Apr 2019 16:08:16 +0000 (+0530) Subject: staging: rtl8712: remove unnecessary NULL check X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=391f544e355d442c8a58d395ef64d01dea47ac8d;p=linux.git staging: rtl8712: remove unnecessary NULL check List wlan_network is built properly with init_list_head and list_add_tail which cancels out its probability of being NULL because of the precence of list_head at the top of this structure. Hence, the NULL test can be omitted. Signed-off-by: Himadri Pandya Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8712/rtl871x_mlme.c b/drivers/staging/rtl8712/rtl871x_mlme.c index e370841a79ca7..7c7267d0fc9e3 100644 --- a/drivers/staging/rtl8712/rtl871x_mlme.c +++ b/drivers/staging/rtl8712/rtl871x_mlme.c @@ -1120,8 +1120,6 @@ int r8712_select_and_join_from_scan(struct mlme_priv *pmlmepriv) } pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list); - if (!pnetwork) - return _FAIL; pmlmepriv->pscanned = pmlmepriv->pscanned->next; if (pmlmepriv->assoc_by_bssid) { dst_ssid = pnetwork->network.MacAddress;