staging: rtl8712: rtl871x_cmd.c: Remove unnecessary null check [Linux 5.3]

This Linux kernel change "staging: rtl8712: rtl871x_cmd.c: Remove unnecessary null check" is included in the Linux 5.3 release. This change is authored by Nishka Dasgupta <nishkadg.linux [at] gmail.com> on Thu Jun 20 17:22:57 2019 +0530. The commit for this change in Linux stable tree is 97a738d (patch).

staging: rtl8712: rtl871x_cmd.c: Remove unnecessary null check

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>

There are 4 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/staging/rtl8712/rtl871x_cmd.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_cmd.c b/drivers/staging/rtl8712/rtl871x_cmd.c
index 94ff875..01146d9 100644
--- a/drivers/staging/rtl8712/rtl871x_cmd.c
+++ b/drivers/staging/rtl8712/rtl871x_cmd.c
@@ -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;

Leave a Reply

Your email address will not be published. Required fields are marked *