From: Jes Sorensen Date: Sun, 25 May 2014 20:43:36 +0000 (+0200) Subject: staging: rtl8723au: rtw_mlme_ext.c: Sanitize calls to alloc_mgtxmitframe23a() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d0fc14642f59f2f5c73e6c3deaab24b81d8f69f2;p=linux-beck.git staging: rtl8723au: rtw_mlme_ext.c: Sanitize calls to alloc_mgtxmitframe23a() Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index a994f1491772..e1b28a234259 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -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 */