linux/drivers/cxl
Arnd Bergmann 7abcb0b106 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: a32320b71f ("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>
2023-02-14 08:36:34 -08:00
..
core cxl: avoid returning uninitialized error code 2023-02-14 08:36:34 -08:00
acpi.c cxl/dax: Create dax devices for CXL RAM regions 2023-02-10 17:33:45 -08:00
cxl.h cxl/dax: Create dax devices for CXL RAM regions 2023-02-10 17:33:45 -08:00
cxlmem.h tools/testing/cxl: Define a fixed volatile configuration to parse 2023-02-10 17:33:04 -08:00
cxlpci.h cxl/pci: Move tracepoint definitions to drivers/cxl/core/ 2023-01-04 17:11:11 -08:00
Kconfig cxl/region: Enable CONFIG_CXL_REGION to be toggled 2023-02-10 17:32:43 -08:00
Makefile cxl/pmem: Introduce nvdimm_security_ops with ->get_flags() operation 2022-11-30 16:30:47 -08:00
mem.c cxl/port: Add RCD endpoint port enumeration 2022-12-05 10:32:26 -08:00
pci.c cxl/pci: Show opcode in debug messages when sending a command 2023-01-24 17:52:54 -08:00
pmem.c cxl/mbox: Enable cxl_mbox_send_cmd() users to validate output size 2022-12-06 14:36:02 -08:00
port.c cxl/region: Add region autodiscovery 2023-02-10 17:32:55 -08:00
security.c cxl/mbox: Enable cxl_mbox_send_cmd() users to validate output size 2022-12-06 14:36:02 -08:00