OpenCloudOS-Kernel/drivers/infiniband/hw/mthca
Leon Romanovsky fff32018b0 RDMA/usnic: Silence uninitialized symbol smatch warnings
[ Upstream commit b9a85e5eec126d6ae6c362f94b447c223e8fe6e4 ]

The patch 1da177e4c3f4: "Linux-2.6.12-rc2" from Apr 16, 2005
(linux-next), leads to the following Smatch static checker warning:

        drivers/infiniband/hw/mthca/mthca_cmd.c:644 mthca_SYS_EN()
        error: uninitialized symbol 'out'.

drivers/infiniband/hw/mthca/mthca_cmd.c
    636 int mthca_SYS_EN(struct mthca_dev *dev)
    637 {
    638         u64 out;
    639         int ret;
    640
    641         ret = mthca_cmd_imm(dev, 0, &out, 0, 0, CMD_SYS_EN, CMD_TIME_CLASS_D);

We pass out here and it gets used without being initialized.

        err = mthca_cmd_post(dev, in_param,
                             out_param ? *out_param : 0,
                                         ^^^^^^^^^^
                             in_modifier, op_modifier,
                             op, context->token, 1);

It's the same in mthca_cmd_wait() and mthca_cmd_poll().

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/533bc3df-8078-4397-b93d-d1f6cec9b636@moroto.mountain
Link: https://lore.kernel.org/r/c559cb7113158c02d75401ac162652072ef1b5f0.1699867650.git.leon@kernel.org
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-01-25 15:35:31 -08:00
..
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mthca_allocator.c IB/mthca: Use non-atomic bitmap functions when possible in 'mthca_allocator.c' 2021-11-25 13:29:06 -04:00
mthca_av.c RDMA: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00
mthca_catas.c treewide: setup_timer() -> timer_setup() (2 field) 2017-11-21 15:57:09 -08:00
mthca_cmd.c RDMA/usnic: Silence uninitialized symbol smatch warnings 2024-01-25 15:35:31 -08:00
mthca_cmd.h IB/core cleanup: Add const on args - device->process_mad 2015-06-02 09:33:13 -04:00
mthca_config_reg.h
mthca_cq.c Linux 5.10-rc6 2020-12-01 20:40:50 -04:00
mthca_dev.h RDMA: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00
mthca_doorbell.h
mthca_eq.c RDMA: switch from 'pci_' to 'dma_' API 2021-08-23 13:43:54 -03:00
mthca_mad.c RDMA: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00
mthca_main.c RDMA/usnic: Silence uninitialized symbol smatch warnings 2024-01-25 15:35:31 -08:00
mthca_mcg.c
mthca_memfree.c RDMA: switch from 'pci_' to 'dma_' API 2021-08-23 13:43:54 -03:00
mthca_memfree.h RDMA: Replace zero-length array with flexible-array member 2020-02-20 13:33:51 -04:00
mthca_mr.c IB/mthca: Use memset_startat() for clearing mpt_entry 2021-12-14 20:21:23 -04:00
mthca_pd.c
mthca_profile.c RDMA/mthca: Delete useless module.h include 2022-01-28 13:03:12 -04:00
mthca_profile.h
mthca_provider.c RDMA/mthca: Remove unnecessary NULL assignments 2023-07-31 10:59:06 +03:00
mthca_provider.h RDMA/mthca: Combine special QP struct with mthca QP 2020-09-29 13:11:07 -03:00
mthca_qp.c RDMA/mthca: Fix crash when polling CQ for shared QPs 2023-07-17 08:02:13 +03:00
mthca_reset.c IB/mthca: Remove debug prints after allocation failure 2016-12-03 13:12:52 -05:00
mthca_srq.c drivers: Remove explicit invocations of mmiowb() 2019-04-08 12:01:02 +01:00
mthca_uar.c
mthca_wqe.h