diff options
author | Arnd Bergmann <arnd@arndb.de> | 2023-02-13 13:12:11 +0300 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2023-02-14 19:36:34 +0300 |
commit | 7abcb0b10668eaf3c174ff383f3b2a7a8c95fb34 (patch) | |
tree | 317ee61cbfd6525da6f19b0bcf552bee84449d2c /lib/iomap_copy.c | |
parent | 09d09e04d2fcf88c4620dd28097e0e2a8f720eac (diff) | |
download | linux-7abcb0b10668eaf3c174ff383f3b2a7a8c95fb34.tar.xz |
cxl: avoid returning uninitialized error code
The new cxl_add_to_region() function returns an uninitialized
value on success:
drivers/cxl/core/region.c:2628:6: error: variable 'rc' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
if (IS_ERR(cxlr)) {
^~~~~~~~~~~~
drivers/cxl/core/region.c:2654:9: note: uninitialized use occurs here
return rc;
Simplify the logic to have the rc variable always initialized in the
same place.
Fixes: a32320b71f08 ("cxl/region: Add region autodiscovery")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230213101220.3821689-1-arnd@kernel.org
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'lib/iomap_copy.c')
0 files changed, 0 insertions, 0 deletions