Patch "RDMA/mlx4: Avoid false error about access to uninitialized gids array" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    RDMA/mlx4: Avoid false error about access to uninitialized gids array

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     rdma-mlx4-avoid-false-error-about-access-to-uninitia.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 6169cfa155cf7c30622f2f4480bab9fc855b43f2
Author: Leon Romanovsky <leon@xxxxxxxxxx>
Date:   Tue Dec 3 15:44:25 2024 +0200

    RDMA/mlx4: Avoid false error about access to uninitialized gids array
    
    [ Upstream commit 1f53d88cbb0dcc7df235bf6611ae632b254fccd8 ]
    
    Smatch generates the following false error report:
    drivers/infiniband/hw/mlx4/main.c:393 mlx4_ib_del_gid() error: uninitialized symbol 'gids'.
    
    Traditionally, we are not changing kernel code and asking people to fix
    the tools. However in this case, the fix can be done by simply rearranging
    the code to be more clear.
    
    Fixes: e26be1bfef81 ("IB/mlx4: Implement ib_device callbacks")
    Link: https://patch.msgid.link/6a3a1577463da16962463fcf62883a87506e9b62.1733233426.git.leonro@xxxxxxxxxx
    Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index 53d83212cda81..67a1ef0260b24 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -392,10 +392,10 @@ static int mlx4_ib_del_gid(const struct ib_gid_attr *attr, void **context)
 	}
 	spin_unlock_bh(&iboe->lock);
 
-	if (!ret && hw_update) {
+	if (gids)
 		ret = mlx4_ib_update_gids(gids, ibdev, attr->port_num);
-		kfree(gids);
-	}
+
+	kfree(gids);
 	return ret;
 }
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux