Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fpga: stratix10-soc: Do not use ret uninitialized in s10_probe()

Clang warns:

drivers/fpga/stratix10-soc.c:431:9: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
return ret;
^~~

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
Reviewed-by: Russ Weight <russell.h.weight@intel.com>
Reviewed-by: Tom Rix <trix@redhat.com>
Acked-by: Xu Yilun <yilun.xu@intel.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Moritz Fischer <mdf@kernel.org>

authored by

Nathan Chancellor and committed by
Moritz Fischer
ea59fc1b 8886a579

+1 -1
+1 -1
drivers/fpga/stratix10-soc.c
··· 428 428 } 429 429 430 430 platform_set_drvdata(pdev, mgr); 431 - return ret; 431 + return 0; 432 432 433 433 probe_err: 434 434 stratix10_svc_free_channel(priv->chan);