staging: rtl8723bs: hal: rtl8723b_cmd: fix Comparison to NULL [Linux 5.3]

This Linux kernel change "staging: rtl8723bs: hal: rtl8723b_cmd: fix Comparison to NULL" is included in the Linux 5.3 release. This change is authored by Hariprasad Kelam <hariprasad.kelam [at] gmail.com> on Wed Jun 19 00:29:08 2019 +0530. The commit for this change in Linux stable tree is a029e22 (patch).

staging: rtl8723bs: hal: rtl8723b_cmd: fix Comparison to NULL

This patch fixes below issues reported by checkpatch

CHECK: Comparison to NULL could be written "psta"
CHECK: Comparison to NULL could be written
"pmlmepriv->wps_probe_resp_ie"
CHECK: Comparison to NULL could be written "psta"

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

 drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
index e001d30..ceb317f 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
@@ -436,7 +436,7 @@ static void ConstructARPResponse(
        DBG_871X("%s(): Add MIC\n", __func__);

        psta = rtw_get_stainfo(&padapter->stapriv, get_my_bssid(&(pmlmeinfo->network)));
-       if (psta != NULL) {
+       if (psta) {
            if (!memcmp(&psta->dot11tkiptxmickey.skey[0], null_key, 16)) {
                DBG_871X("%s(): STA dot11tkiptxmickey == 0\n", __func__);
            }
@@ -753,7 +753,7 @@ static void ConstructProbeRsp(struct adapter *padapter, u8 *pframe, u32 *pLength
            cur_network->IELength-_FIXED_IE_LENGTH_, NULL, &wps_ielen);

    /* inerset & update wps_probe_resp_ie */
-   if ((pmlmepriv->wps_probe_resp_ie != NULL) && pwps_ie && (wps_ielen > 0)) {
+   if (pmlmepriv->wps_probe_resp_ie && pwps_ie && (wps_ielen > 0)) {
        uint wps_offset, remainder_ielen;
        u8 *premainder_ie;

@@ -1316,7 +1316,7 @@ static void rtl8723b_set_FwWoWlanRelated_cmd(struct adapter *padapter, u8 enable

        if (!(ppwrpriv->wowlan_pno_enable)) {
            psta = rtw_get_stainfo(&padapter->stapriv, get_bssid(pmlmepriv));
-           if (psta != NULL)
+           if (psta)
                rtl8723b_set_FwMediaStatusRpt_cmd(padapter, RT_MEDIA_CONNECT, psta->mac_id);
        } else
            DBG_871X("%s(): Disconnected, no FwMediaStatusRpt CONNECT\n", __func__);

Leave a Reply

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