diff options
author | Nishka Dasgupta <nishkadg.linux@gmail.com> | 2019-06-26 11:39:38 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-07-01 10:44:06 +0200 |
commit | e1b5fe7412b00e248dc948cadfdbfd9c008bc87c (patch) | |
tree | f4082e49e64f6e90a94e99104839439736bf3640 /drivers/staging/rtl8712 | |
parent | a024c9dfefc0c882c6a908e0d83de3f413b59190 (diff) | |
download | linux-e1b5fe7412b00e248dc948cadfdbfd9c008bc87c.tar.bz2 |
staging: rtl8712: _r8712_init_sta_priv(): Change return values
Add check for the return value of function _r8712_init_sta_priv at call
site.
Change return values of the function from _SUCCESS/_FAIL to 0/-ENOMEM
respectively.
Change return type of the function from u32 to int to enable return of
-ENOMEM.
Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8712')
-rw-r--r-- | drivers/staging/rtl8712/os_intfs.c | 3 | ||||
-rw-r--r-- | drivers/staging/rtl8712/rtl871x_sta_mgt.c | 6 | ||||
-rw-r--r-- | drivers/staging/rtl8712/sta_info.h | 2 |
3 files changed, 6 insertions, 5 deletions
diff --git a/drivers/staging/rtl8712/os_intfs.c b/drivers/staging/rtl8712/os_intfs.c index 85a43fd67ca5..b554cf8bd679 100644 --- a/drivers/staging/rtl8712/os_intfs.c +++ b/drivers/staging/rtl8712/os_intfs.c @@ -310,7 +310,8 @@ u8 r8712_init_drv_sw(struct _adapter *padapter) sizeof(struct security_priv)); timer_setup(&padapter->securitypriv.tkip_timer, r8712_use_tkipkey_handler, 0); - _r8712_init_sta_priv(&padapter->stapriv); + if (_r8712_init_sta_priv(&padapter->stapriv)) + return _FAIL; padapter->stapriv.padapter = padapter; r8712_init_bcmc_stainfo(padapter); r8712_init_pwrctrl_priv(padapter); diff --git a/drivers/staging/rtl8712/rtl871x_sta_mgt.c b/drivers/staging/rtl8712/rtl871x_sta_mgt.c index b549ab37f2dc..653812c5d5a8 100644 --- a/drivers/staging/rtl8712/rtl871x_sta_mgt.c +++ b/drivers/staging/rtl8712/rtl871x_sta_mgt.c @@ -34,7 +34,7 @@ static void _init_stainfo(struct sta_info *psta) INIT_LIST_HEAD(&psta->auth_list); } -u32 _r8712_init_sta_priv(struct sta_priv *pstapriv) +int _r8712_init_sta_priv(struct sta_priv *pstapriv) { struct sta_info *psta; s32 i; @@ -42,7 +42,7 @@ u32 _r8712_init_sta_priv(struct sta_priv *pstapriv) pstapriv->pallocated_stainfo_buf = kmalloc(sizeof(struct sta_info) * NUM_STA + 4, GFP_ATOMIC); if (!pstapriv->pallocated_stainfo_buf) - return _FAIL; + return -ENOMEM; pstapriv->pstainfo_buf = pstapriv->pallocated_stainfo_buf + 4 - ((addr_t)(pstapriv->pallocated_stainfo_buf) & 3); _init_queue(&pstapriv->free_sta_queue); @@ -59,7 +59,7 @@ u32 _r8712_init_sta_priv(struct sta_priv *pstapriv) } INIT_LIST_HEAD(&pstapriv->asoc_list); INIT_LIST_HEAD(&pstapriv->auth_list); - return _SUCCESS; + return 0; } /* this function is used to free the memory of lock || sema for all stainfos */ diff --git a/drivers/staging/rtl8712/sta_info.h b/drivers/staging/rtl8712/sta_info.h index fc32dc0bed00..d042d900f30c 100644 --- a/drivers/staging/rtl8712/sta_info.h +++ b/drivers/staging/rtl8712/sta_info.h @@ -119,7 +119,7 @@ static inline u32 wifi_mac_hash(u8 *mac) return x; } -u32 _r8712_init_sta_priv(struct sta_priv *pstapriv); +int _r8712_init_sta_priv(struct sta_priv *pstapriv); void _r8712_free_sta_priv(struct sta_priv *pstapriv); struct sta_info *r8712_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr); |