staging: rtl8723au: _cfg80211_rtw_mgmt_tx() clean up checking function return values
authorJes Sorensen <Jes.Sorensen@redhat.com>
Sun, 25 May 2014 20:43:14 +0000 (22:43 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 May 2014 22:14:40 +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/os_dep/ioctl_cfg80211.c

index 09e6e8180c768e84879be272495ec1b10a39ad32..5f508ac765e2442b9a8d1486f099403eda3f536b 100644 (file)
@@ -3055,7 +3055,6 @@ static int _cfg80211_rtw_mgmt_tx(struct rtw_adapter *padapter, u8 tx_ch,
        struct pkt_attrib *pattrib;
        unsigned char *pframe;
        int ret = _FAIL;
-       bool ack = true;
        struct ieee80211_hdr *pwlanhdr;
        struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
        struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
@@ -3079,7 +3078,7 @@ static int _cfg80211_rtw_mgmt_tx(struct rtw_adapter *padapter, u8 tx_ch,
 
        /* starting alloc mgmt frame to dump it */
        pmgntframe = alloc_mgtxmitframe23a(pxmitpriv);
-       if (pmgntframe == NULL) {
+       if (!pmgntframe) {
                /* ret = -ENOMEM; */
                ret = _FAIL;
                goto exit;
@@ -3105,15 +3104,12 @@ static int _cfg80211_rtw_mgmt_tx(struct rtw_adapter *padapter, u8 tx_ch,
 
        pattrib->last_txcmdsz = pattrib->pktlen;
 
-       if (dump_mgntframe23a_and_wait_ack23a(padapter, pmgntframe) != _SUCCESS) {
-               ack = false;
-               ret = _FAIL;
+       ret = dump_mgntframe23a_and_wait_ack23a(padapter, pmgntframe);
 
-               DBG_8723A("%s, ack == _FAIL\n", __func__);
-       } else {
-               DBG_8723A("%s, ack =%d, ok!\n", __func__, ack);
-               ret = _SUCCESS;
-       }
+       if (ret  != _SUCCESS)
+               DBG_8723A("%s, ack == false\n", __func__);
+       else
+               DBG_8723A("%s, ack == true\n", __func__);
 
 exit: