staging: rtl8723au: rtw_mlme_ext.c: Sanitize calls to alloc_mgtxmitframe23a()
authorJes Sorensen <Jes.Sorensen@redhat.com>
Sun, 25 May 2014 20:43:36 +0000 (22:43 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 May 2014 22:14:44 +0000 (15:14 -0700)
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/core/rtw_mlme_ext.c

index a994f14..e1b28a2 100644 (file)
@@ -2467,7 +2467,8 @@ void issue_beacon23a(struct rtw_adapter *padapter, int timeout_ms)
 
        /* DBG_8723A("%s\n", __func__); */
 
-       if ((pmgntframe = alloc_mgtxmitframe23a(pxmitpriv)) == NULL) {
+       pmgntframe = alloc_mgtxmitframe23a(pxmitpriv);
+       if (!pmgntframe) {
                DBG_8723A("%s, alloc mgnt frame fail\n", __func__);
                return;
        }
@@ -2843,7 +2844,8 @@ static int _issue_probereq(struct rtw_adapter *padapter,
        RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_,
                 ("+%s\n", __func__));
 
-       if ((pmgntframe = alloc_mgtxmitframe23a(pxmitpriv)) == NULL)
+       pmgntframe = alloc_mgtxmitframe23a(pxmitpriv);
+       if (!pmgntframe)
                goto exit;
 
        /* update attribute */
@@ -2991,7 +2993,8 @@ static void issue_auth(struct rtw_adapter *padapter, struct sta_info *psta,
        struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
        struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
 
-       if ((pmgntframe = alloc_mgtxmitframe23a(pxmitpriv)) == NULL)
+       pmgntframe = alloc_mgtxmitframe23a(pxmitpriv);
+       if (!pmgntframe)
                return;
 
        /* update attribute */
@@ -3569,7 +3572,8 @@ static int _issue_nulldata23a(struct rtw_adapter *padapter, unsigned char *da,
        pmlmeext = &padapter->mlmeextpriv;
        pmlmeinfo = &pmlmeext->mlmext_info;
 
-       if ((pmgntframe = alloc_mgtxmitframe23a(pxmitpriv)) == NULL)
+       pmgntframe = alloc_mgtxmitframe23a(pxmitpriv);
+       if (!pmgntframe)
                goto exit;
 
        /* update attribute */
@@ -3685,7 +3689,8 @@ static int _issue_qos_nulldata23a(struct rtw_adapter *padapter,
 
        DBG_8723A("%s\n", __func__);
 
-       if ((pmgntframe = alloc_mgtxmitframe23a(pxmitpriv)) == NULL)
+       pmgntframe = alloc_mgtxmitframe23a(pxmitpriv);
+       if (!pmgntframe)
                goto exit;
 
        /* update attribute */
@@ -3810,7 +3815,8 @@ static int _issue_deauth(struct rtw_adapter *padapter, unsigned char *da,
 
        /* DBG_8723A("%s to "MAC_FMT"\n", __func__, MAC_ARG(da)); */
 
-       if ((pmgntframe = alloc_mgtxmitframe23a(pxmitpriv)) == NULL)
+       pmgntframe = alloc_mgtxmitframe23a(pxmitpriv);
+       if (!pmgntframe)
                goto exit;
 
        /* update attribute */
@@ -3921,7 +3927,8 @@ void issue_action_spct_ch_switch23a(struct rtw_adapter *padapter,
        DBG_8723A("%s(%s): ra ="MAC_FMT", ch:%u, offset:%u\n", __func__,
                  padapter->pnetdev->name, MAC_ARG(ra), new_ch, ch_offset);
 
-       if ((pmgntframe = alloc_mgtxmitframe23a(pxmitpriv)) == NULL)
+       pmgntframe = alloc_mgtxmitframe23a(pxmitpriv);
+       if (!pmgntframe)
                return;
 
        /* update attribute */
@@ -3990,7 +3997,8 @@ void issue_action_BA23a(struct rtw_adapter *padapter,
        DBG_8723A("%s, category =%d, action =%d, status =%d\n",
                  __func__, category, action, status);
 
-       if ((pmgntframe = alloc_mgtxmitframe23a(pxmitpriv)) == NULL)
+       pmgntframe = alloc_mgtxmitframe23a(pxmitpriv);
+       if (!pmgntframe)
                return;
 
        /* update attribute */