staging: rtl8712: rtl871x_cmd.c: Remove unnecessary null check
authorNishka Dasgupta <nishkadg.linux@gmail.com>
Thu, 20 Jun 2019 11:52:57 +0000 (17:22 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Jun 2019 12:47:28 +0000 (14:47 +0200)
Remove the check for whether the value of variable psecnetwork is NULL
as psecnetwork is a field of a field of a non-NULL pointer, and
therefore cannot be NULL itself.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8712/rtl871x_cmd.c

index 94ff875..01146d9 100644 (file)
@@ -468,10 +468,6 @@ u8 r8712_joinbss_cmd(struct _adapter  *padapter, struct wlan_network *pnetwork)
                }
        }
        psecnetwork = &psecuritypriv->sec_bss;
-       if (!psecnetwork) {
-               kfree(pcmd);
-               return _FAIL;
-       }
        memcpy(psecnetwork, &pnetwork->network, sizeof(*psecnetwork));
        psecuritypriv->authenticator_ie[0] = (unsigned char)
                                             psecnetwork->IELength;