]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
RDMA/mana_ib: Ensure variable err is initialized
authorKees Bakker <kees@ijzerbout.nl>
Fri, 21 Feb 2025 19:39:03 +0000 (20:39 +0100)
committerLeon Romanovsky <leon@kernel.org>
Sun, 23 Feb 2025 11:27:52 +0000 (06:27 -0500)
In the function mana_ib_gd_create_dma_region if there are no dma blocks
to process the variable `err` remains uninitialized.

Fixes: 0266a177631d ("RDMA/mana_ib: Add a driver for Microsoft Azure Network Adapter")
Signed-off-by: Kees Bakker <kees@ijzerbout.nl>
Link: https://patch.msgid.link/20250221195833.7516C16290A@bout3.ijzerbout.nl
Reviewed-by: Long Li <longli@microsoft.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/mana/main.c

index e3230fe31fbc81ef1d68060d77b30df7418e2057..730f958aa2a8e44877b835df58cc36eb7a8d1301 100644 (file)
@@ -384,7 +384,7 @@ static int mana_ib_gd_create_dma_region(struct mana_ib_dev *dev, struct ib_umem
        unsigned int tail = 0;
        u64 *page_addr_list;
        void *request_buf;
-       int err;
+       int err = 0;
 
        gc = mdev_to_gc(dev);
        hwc = gc->hwc.driver_data;