lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 28 Mar 2022 08:44:39 +0000
From:   白浩文 <baihaowen@...zu.com>
To:     Martin Kaiser <martin@...ser.cx>
CC:     "Larry.Finger@...inger.net" <Larry.Finger@...inger.net>,
        "phil@...lpotter.co.uk" <phil@...lpotter.co.uk>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "straube.linux@...il.com" <straube.linux@...il.com>,
        "linux-staging@...ts.linux.dev" <linux-staging@...ts.linux.dev>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: 答复: [PATCH] staging: r8188eu: Directly return instead of using local ret variable

Thank you for your suggestion, resend again.
________________________________________
发件人: Martin Kaiser <martin@...i.kaiser.cx> 代表 Martin Kaiser <martin@...ser.cx>
发送时间: 2022年3月28日 16:08:17
收件人: 白浩文
抄送: Larry.Finger@...inger.net; phil@...lpotter.co.uk; gregkh@...uxfoundation.org; straube.linux@...il.com; linux-staging@...ts.linux.dev; linux-kernel@...r.kernel.org
主题: Re: [PATCH] staging: r8188eu: Directly return instead of using local ret variable

Thus wrote Haowen Bai (baihaowen@...zu.com):

> From: 白浩文 <baihaowen@...zu.com>

> fixes coccinelle warning:
> ./drivers/staging/r8188eu/core/rtw_mlme_ext.c:1518:14-17: Unneeded variable: "ret".
>  Return "_FAIL" on line 1549
> ./drivers/staging/r8188eu/core/rtw_mlme_ext.c:357:5-8: Unneeded variable: "res".
>  Return "_SUCCESS" on line 380

These are two unrelated changes. I guess you should split this into two
patches.

> Signed-off-by: 白浩文 <baihaowen@...zu.com>
> ---
>  drivers/staging/r8188eu/core/rtw_mlme_ext.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

> diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
> index 10d5f12..4b7b0ee 100644
> --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c
> +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
> @@ -354,7 +354,6 @@ static u8 init_channel_set(struct adapter *padapter, u8 ChannelPlan, struct rt_c

>  int  init_mlme_ext_priv(struct adapter *padapter)
>  {
> -     int     res = _SUCCESS;
>       struct registry_priv *pregistrypriv = &padapter->registrypriv;
>       struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
>       struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
> @@ -377,7 +376,7 @@ int       init_mlme_ext_priv(struct adapter *padapter)

>       pmlmeext->active_keep_alive_check = true;

> -     return res;
> +     return _SUCCESS;
>  }

The caller does not check the return value. You should change the
function to void init_mlme_ext_priv...

>  void free_mlme_ext_priv(struct mlme_ext_priv *pmlmeext)
> @@ -1515,7 +1514,6 @@ unsigned int OnAtim(struct adapter *padapter, struct recv_frame *precv_frame)

>  unsigned int on_action_spct(struct adapter *padapter, struct recv_frame *precv_frame)
>  {
> -     unsigned int ret = _FAIL;
>       struct sta_info *psta = NULL;
>       struct sta_priv *pstapriv = &padapter->stapriv;
>       u8 *pframe = precv_frame->rx_data;
> @@ -1546,7 +1544,7 @@ unsigned int on_action_spct(struct adapter *padapter, struct recv_frame *precv_f
>       }

>  exit:
> -     return ret;
> +     return _FAIL;
>  }
>  unsigned int OnAction_qos(struct adapter *padapter, struct recv_frame *precv_frame)
> --
> 2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ