[10/20] staging: r8188eu: simplify rtw_make_wlanhdr's error handling

Message ID 20221230180646.91008-11-martin@kaiser.cx
State New
Headers
Series staging: r8188eu: some xmit cleanups |

Commit Message

Martin Kaiser Dec. 30, 2022, 6:06 p.m. UTC
  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>
---
 drivers/staging/r8188eu/core/rtw_xmit.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
  

Patch

diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c
index 502f9a6f4250..6e3b5649b84c 100644
--- a/drivers/staging/r8188eu/core/rtw_xmit.c
+++ b/drivers/staging/r8188eu/core/rtw_xmit.c
@@ -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)