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: <410b9067-588b-881e-da03-fa970ef576b1@redhat.com>
Date:   Mon, 29 Nov 2021 08:35:44 -0800
From:   Tom Rix <trix@...hat.com>
To:     Nathan Chancellor <nathan@...nel.org>,
        Moritz Fischer <mdf@...nel.org>, Wu Hao <hao.wu@...el.com>,
        Xu Yilun <yilun.xu@...el.com>
Cc:     Nick Desaulniers <ndesaulniers@...gle.com>,
        Russ Weight <russell.h.weight@...el.com>,
        Dan Carpenter <dan.carpenter@...cle.com>,
        linux-fpga@...r.kernel.org, linux-kernel@...r.kernel.org,
        llvm@...ts.linux.dev
Subject: Re: [PATCH] fpga: stratix10-soc: Do not use ret uninitialized in
 s10_probe()


On 11/29/21 8:10 AM, Nathan Chancellor wrote:
> Clang warns:
>
> drivers/fpga/stratix10-soc.c:431:9: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
>          return ret;
>                 ^~~
> drivers/fpga/stratix10-soc.c:402:9: note: initialize the variable 'ret' to silence this warning
>          int ret;
>                 ^
>                  = 0

This line to contradicts what you did, to reduce confusion, remove the 
'silence this warning line'

Change itself looks fine.

Reviewed-by: Tom Rix <trix@...hat.com>

> 1 warning generated.
>
> ret is only assigned in an error path now so just return 0 directly.
>
> Fixes: 4ba0b2c294fe ("fpga: mgr: Use standard dev_release for class driver")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1517
> Signed-off-by: Nathan Chancellor <nathan@...nel.org>
> ---
>   drivers/fpga/stratix10-soc.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/fpga/stratix10-soc.c b/drivers/fpga/stratix10-soc.c
> index 737d14c6e0de..357cea58ec98 100644
> --- a/drivers/fpga/stratix10-soc.c
> +++ b/drivers/fpga/stratix10-soc.c
> @@ -428,7 +428,7 @@ static int s10_probe(struct platform_device *pdev)
>   	}
>   
>   	platform_set_drvdata(pdev, mgr);
> -	return ret;
> +	return 0;
>   
>   probe_err:
>   	stratix10_svc_free_channel(priv->chan);
>
> base-commit: 8886a579744fbfa53e69aa453ed10ae3b1f9abac

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ