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]
Message-ID: <20210420110609.GD1981@kadam>
Date:   Tue, 20 Apr 2021 14:06:09 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Saurav Girepunje <saurav.girepunje@...il.com>
Cc:     gregkh@...uxfoundation.org, fabioaiuto83@...il.com,
        hello@...anbrattlof.com, hdegoede@...hat.com,
        saurav.girepunje@...gle.com, john.oldman@...ehill.co.uk,
        linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
        saurav.girepunje@...mail.com
Subject: Re: [PATCH] staging: rtl8723bs: os_dep: remove multiple return

On Sun, Apr 18, 2021 at 11:02:33PM +0530, Saurav Girepunje wrote:
> on sdio_intf.c rtw_sdio_suspend call we have multiple
> return which can replace by goto exit. As in all the places
> return value is 0.
> 
> Signed-off-by: Saurav Girepunje <saurav.girepunje@...gle.com>
> ---
>  drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
> index a9a9631dd23c..3e566cf97f6e 100644
> --- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
> +++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
> @@ -445,14 +445,17 @@ static int rtw_sdio_suspend(struct device *dev)
>  	struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
>  
>  	if (padapter->bDriverStopped)
> -		return 0;
> +		goto exit;
>  
>  	if (pwrpriv->bInSuspend) {
>  		pdbgpriv->dbg_suspend_error_cnt++;
> -		return 0;
> +		goto exit;
>  	}
>  
> -	return rtw_suspend_common(padapter);
> +	rtw_suspend_common(padapter);

Also it's weird that your previous patch made rtw_suspend_common()
return zero unconditionally.  But now we're modifying the only caller to
not check the return.  Just make rtw_suspend_common() void and change
this to:

	rtw_suspend_common(padapter);

	return 0;

regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ