This is a note to let you know that I've just added the patch titled drm/amdgpu: fix uninitialized variable warning for amdgpu_xgmi to the 6.10-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: drm-amdgpu-fix-uninitialized-variable-warning-for-am.patch and it can be found in the queue-6.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit fb792822512b563b3d9607f4f01445577ab9575e Author: Tim Huang <Tim.Huang@xxxxxxx> Date: Mon May 6 13:48:57 2024 +0800 drm/amdgpu: fix uninitialized variable warning for amdgpu_xgmi [ Upstream commit 8f184f8e7a07fddc33ee4e6a38b717c770c3aedd ] Clear warning that using uninitialized variable current_node. Signed-off-by: Tim Huang <Tim.Huang@xxxxxxx> Reviewed-by: Alex Deucher <alexander.deucher@xxxxxxx> Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c index dd2ec48cf5c2..4a14f9c1bfe8 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c @@ -434,6 +434,9 @@ static ssize_t amdgpu_xgmi_show_connected_port_num(struct device *dev, } } + if (i == top->num_nodes) + return -EINVAL; + for (i = 0; i < top->num_nodes; i++) { for (j = 0; j < top->nodes[i].num_links; j++) /* node id in sysfs starts from 1 rather than 0 so +1 here */