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] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 2 Nov 2021 11:23:58 +0300
From:   Pavel Skripkin <paskripkin@...il.com>
To:     cgel.zte@...il.com, Larry.Finger@...inger.net
Cc:     phil@...lpotter.co.uk, gregkh@...uxfoundation.org,
        straube.linux@...il.com, fmdefrancesco@...il.com,
        saurav.girepunje@...il.com, linux-staging@...ts.linux.dev,
        linux-kernel@...r.kernel.org,
        Changcheng Deng <deng.changcheng@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH] staging: r8188eu: remove unneeded variable

On 11/2/21 10:32, cgel.zte@...il.com wrote:
> From: Changcheng Deng <deng.changcheng@....com.cn>
> 
> Remove unneeded variable used to store return value.
> 
> Reported-by: Zeal Robot <zealci@....com.cn>
> Signed-off-by: Changcheng Deng <deng.changcheng@....com.cn>
> ---
>   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 995a0248c26f..98863a06bdb6 100644
> --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c
> +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
> @@ -350,7 +350,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;
> @@ -373,7 +372,7 @@ int	init_mlme_ext_priv(struct adapter *padapter)
>   
>   	pmlmeext->active_keep_alive_check = true;
>   
> -	return res;
> +	return _SUCCESS;
>   }

Looks like it always return success, so, maybe, it should return just void?

>   
>   void free_mlme_ext_priv(struct mlme_ext_priv *pmlmeext)
> @@ -1611,7 +1610,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;
> @@ -1644,7 +1642,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)
> 

This looks odd from the beginning... Why return _FAIL even on success?
Anyway, nothing checks these handlers return values:

		ptable = &OnAction_tbl[i];
		if (category == ptable->num)
			ptable->func(padapter, precv_frame);

So, it worth to make them void too, but, I guess, it's out of scope of 
current patch



With regards,
Pavel Skripkin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ