staging: r8188eu: simplify rtw_make_wlanhdr's error handling
authorMartin Kaiser <martin@kaiser.cx>
Fri, 30 Dec 2022 18:06:36 +0000 (19:06 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Jan 2023 18:31:22 +0000 (19:31 +0100)
Simplify the error handling in rtw_make_wlanhdr. Exit immediately instead
of jumping to the end of the function. We don't have to do any clean-up.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20221230180646.91008-11-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_xmit.c

index becd1db0c628f0d456f7ef9ed1eb207c7379572b..bb45d59497fa75444922d71f95ab3c2a03abd1ee 100644 (file)
@@ -792,8 +792,6 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr
        struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
        struct qos_priv *pqospriv = &pmlmepriv->qospriv;
        u8 qos_option = false;
-
-       int res = _SUCCESS;
        __le16 *fctrl = &pwlanhdr->frame_control;
 
        struct sta_info *psta;
@@ -840,8 +838,7 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr
                if (psta->qos_option)
                        qos_option = true;
        } else {
-               res = _FAIL;
-               goto exit;
+               return _FAIL;
        }
 
        if (pattrib->mdata)
@@ -897,9 +894,8 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr
                        }
                }
        }
-exit:
 
-       return res;
+       return _SUCCESS;
 }
 
 s32 rtw_txframes_pending(struct adapter *padapter)