aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Straube <[email protected]>2022-10-02 09:48:26 +0200
committerGreg Kroah-Hartman <[email protected]>2022-10-20 17:19:37 +0200
commit40b3f62227d46d21eab71832e331e3aa740b1b34 (patch)
tree1a301d745ac0fda9223b04631718461dca3ba656
parentd4fda24757678311ff0a219bd150a3c3aeb6a2f8 (diff)
staging: r8188eu: convert rtw_init_mlme_priv() to common error logic
Convert the function rtw_init_mlme_priv() to common kernel error logic. Return 0 on success and negative value on failure. This is part of getting rid of returning _SUCCESS and _FAIL which uses inverted error logic and is used all over the driver. Signed-off-by: Michael Straube <[email protected]> Tested-by: Philipp Hortmann <[email protected]> # Edimax N150 Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--drivers/staging/r8188eu/core/rtw_mlme.c12
-rw-r--r--drivers/staging/r8188eu/os_dep/os_intfs.c2
2 files changed, 5 insertions, 9 deletions
diff --git a/drivers/staging/r8188eu/core/rtw_mlme.c b/drivers/staging/r8188eu/core/rtw_mlme.c
index 5ca03d6cac32..1f69e5c57d5d 100644
--- a/drivers/staging/r8188eu/core/rtw_mlme.c
+++ b/drivers/staging/r8188eu/core/rtw_mlme.c
@@ -224,7 +224,6 @@ int rtw_init_mlme_priv(struct adapter *padapter)/* struct mlme_priv *pmlmepriv)
u8 *pbuf;
struct wlan_network *pnetwork;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
- int res = _SUCCESS;
/* We don't need to memset padapter->XXX to zero, because adapter is allocated by vzalloc(). */
@@ -245,10 +244,9 @@ int rtw_init_mlme_priv(struct adapter *padapter)/* struct mlme_priv *pmlmepriv)
pbuf = vzalloc(MAX_BSS_CNT * (sizeof(struct wlan_network)));
- if (!pbuf) {
- res = _FAIL;
- goto exit;
- }
+ if (!pbuf)
+ return -ENOMEM;
+
pmlmepriv->free_bss_buf = pbuf;
pnetwork = (struct wlan_network *)pbuf;
@@ -265,9 +263,7 @@ int rtw_init_mlme_priv(struct adapter *padapter)/* struct mlme_priv *pmlmepriv)
rtw_init_mlme_timer(padapter);
-exit:
-
- return res;
+ return 0;
}
void rtw_free_mlme_priv(struct mlme_priv *pmlmepriv)
diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c
index 490e0c7dc034..d8b8a5291e40 100644
--- a/drivers/staging/r8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/r8188eu/os_dep/os_intfs.c
@@ -473,7 +473,7 @@ u8 rtw_init_drv_sw(struct adapter *padapter)
goto free_cmd_priv;
}
- if (rtw_init_mlme_priv(padapter) == _FAIL) {
+ if (rtw_init_mlme_priv(padapter)) {
dev_err(dvobj_to_dev(padapter->dvobj), "rtw_init_mlme_priv failed\n");
goto free_evt_priv;
}