From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A386C1CD15; Sat, 3 Feb 2024 04:18:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706933889; cv=none; b=bIZ6bIMJnnTyK3AZKD154C3iBcZGvthZgIHwvuDra/T5a3UelBgbl4h2dXKSB4ITrdNIJuJJAy1TfQQ2frLkSZBZQQo9mfph1Ez8b9k4m7TLLS5Ow3Pye4DUsZ2NrsRk46FTP72mtlb5V91DIYzORUgfW18jJutdtB9qJrRMys8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706933889; c=relaxed/simple; bh=ookYTjzVhslnTxb86PN11RhxS1K7+rP3pVGa8tS2iDQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Fu90MZ5raIRVEg8oiNM1PGe0ttuins3DSlid+KIEn15Al8Cv1iRZF35QHHwKay+ZJSZ0QTe+lKKucLI3qHzQ5NpCDq6IeahFGlLS14/f0Q2UsSEYagcj/Mgiwmp3LfglUkK8UZ67/sgj1wOU1E2AhOQI1MVbDrJllRYAL4YkEoQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ooW+g6Ei; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ooW+g6Ei" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CF81C433C7; Sat, 3 Feb 2024 04:18:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1706933889; bh=ookYTjzVhslnTxb86PN11RhxS1K7+rP3pVGa8tS2iDQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ooW+g6EiAnZq+fDZiijRsOzgEOjPZPaO2PXKVgZ73j21RdRdfKDCRiLCqDIjdJPly ov7MiKjzybjRWSzWUQ50hUjrW3UgSSLSjQlsR1Zt7OzkeLkWQV8aYrMobNTAgMIwlo 4CyvCxK4V5CvUl1cGNBZ9II0nH0uY1oqqYOyfDtU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Felix Kuehling , =?UTF-8?q?Christian=20K=C3=B6nig?= , Alex Deucher , Srinivasan Shanmugam , Felix Kuehling , Sasha Levin Subject: [PATCH 6.7 234/353] drm/amdkfd: Fix iterator used outside loop in kfd_add_peer_prop() Date: Fri, 2 Feb 2024 20:05:52 -0800 Message-ID: <20240203035411.080065087@linuxfoundation.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240203035403.657508530@linuxfoundation.org> References: <20240203035403.657508530@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.7-stable review patch. If anyone has any objections, please let me know. ------------------ From: Srinivasan Shanmugam [ Upstream commit b1a428b45dc7e47c7acc2ad0d08d8a6dda910c4c ] Fix the following about iterator use: drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_topology.c:1456 kfd_add_peer_prop() warn: iterator used outside loop: 'iolink3' Cc: Felix Kuehling Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 24 ++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c index 58d775a0668d..e5f7c92eebcb 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c @@ -1452,17 +1452,19 @@ static int kfd_add_peer_prop(struct kfd_topology_device *kdev, /* CPU->CPU link*/ cpu_dev = kfd_topology_device_by_proximity_domain(iolink1->node_to); if (cpu_dev) { - list_for_each_entry(iolink3, &cpu_dev->io_link_props, list) - if (iolink3->node_to == iolink2->node_to) - break; - - props->weight += iolink3->weight; - props->min_latency += iolink3->min_latency; - props->max_latency += iolink3->max_latency; - props->min_bandwidth = min(props->min_bandwidth, - iolink3->min_bandwidth); - props->max_bandwidth = min(props->max_bandwidth, - iolink3->max_bandwidth); + list_for_each_entry(iolink3, &cpu_dev->io_link_props, list) { + if (iolink3->node_to != iolink2->node_to) + continue; + + props->weight += iolink3->weight; + props->min_latency += iolink3->min_latency; + props->max_latency += iolink3->max_latency; + props->min_bandwidth = min(props->min_bandwidth, + iolink3->min_bandwidth); + props->max_bandwidth = min(props->max_bandwidth, + iolink3->max_bandwidth); + break; + } } else { WARN(1, "CPU node not found"); } -- 2.43.0