AMD-GFX Archive mirror
 help / color / mirror / Atom feed
From: Jesse Zhang <jesse.zhang@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: <Alexander.Deucher@amd.com>,
	Christian Koenig <christian.koenig@amd.com>,  <Tim.Huang@amd.com>,
	Jesse Zhang <jesse.zhang@amd.com>,
	Jesse Zhang <Jesse.Zhang@amd.com>
Subject: [PATCH 01/22] drm/amdgpu: fix dereference after null check
Date: Fri, 10 May 2024 10:50:17 +0800	[thread overview]
Message-ID: <20240510025038.3488381-1-jesse.zhang@amd.com> (raw)

check the pointer hive before use.

Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 77f6fd50002a..00fe3c2d5431 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -5725,7 +5725,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
 	 * to put adev in the 1st position.
 	 */
 	INIT_LIST_HEAD(&device_list);
-	if (!amdgpu_sriov_vf(adev) && (adev->gmc.xgmi.num_physical_nodes > 1)) {
+	if (!amdgpu_sriov_vf(adev) && (adev->gmc.xgmi.num_physical_nodes > 1) && hive) {
 		list_for_each_entry(tmp_adev, &hive->device_list, gmc.xgmi.head) {
 			list_add_tail(&tmp_adev->reset_list, &device_list);
 			if (adev->shutdown)
-- 
2.25.1


             reply	other threads:[~2024-05-10  2:51 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-10  2:50 Jesse Zhang [this message]
2024-05-10  2:50 ` [PATCH 02/22] drm/amdgpu: the warning dereferencing obj for nbio_v7_4 Jesse Zhang
2024-05-13  2:18   ` Zhang, Jesse(Jie)
2024-05-13  4:22     ` Huang, Tim
2024-05-13  6:29       ` Zhang, Jesse(Jie)
2024-05-10  2:50 ` [PATCH 03/22] drm/amdgpu: fix the waring dereferencing hive Jesse Zhang
2024-05-10  6:20   ` Huang, Tim
2024-05-10  2:50 ` [PATCH 04/22] drm/amd: fix the warning unchecking return vaule for sdma_v7 Jesse Zhang
2024-05-10  6:27   ` Huang, Tim
2024-05-10  2:50 ` [PATCH 05/22] drm/amd/pm: check specific index for aldebaran Jesse Zhang
2024-05-10  3:28   ` Wang, Yang(Kevin)
2024-05-10  6:29   ` Huang, Tim
2024-05-13 11:08   ` Lazar, Lijo
2024-05-10  2:50 ` [PATCH 06/22] drm/amd/pm: check the return of send smc msg for sienna_cichild Jesse Zhang
2024-05-10  7:41   ` Huang, Tim
2024-05-10  2:50 ` [PATCH 07/22] drm/amd/pm: check the return of send smc msg for navi10 Jesse Zhang
2024-05-10  7:42   ` Huang, Tim
2024-05-10  2:50 ` [PATCH 08/22] drm/amd/pm: check the return of send smc msg for smu_v13 Jesse Zhang
2024-05-10  7:42   ` Huang, Tim
2024-05-10  2:50 ` [PATCH 09/22] drm/amd/pm: check specific index for smu13 Jesse Zhang
2024-05-10  3:26   ` Wang, Yang(Kevin)
2024-05-10  6:37   ` Huang, Tim
2024-05-10  6:52     ` Zhang, Jesse(Jie)
2024-05-13 10:57   ` Lazar, Lijo
2024-05-13 11:04     ` Lazar, Lijo
2024-05-10  2:50 ` [PATCH 10/22] drm/amdgpu: remove structurally dead code Jesse Zhang
2024-05-10  6:38   ` Huang, Tim
2024-05-10  2:50 ` [PATCH 11/22] drm/amdgpu: remove structurally dead code for amd_gmc Jesse Zhang
2024-05-10  6:39   ` Huang, Tim
2024-05-10  2:50 ` [PATCH 12/22] drm/amd/pm: remove logically dead code Jesse Zhang
2024-05-13  2:19   ` Zhang, Jesse(Jie)
2024-05-13  2:58     ` Wang, Yang(Kevin)
2024-05-10  2:50 ` [PATCH 13/22] drm/amd/pm: remove logically dead code for renoir Jesse Zhang
2024-05-10  3:34   ` Wang, Yang(Kevin)
2024-05-10  2:50 ` [PATCH 14/22] drm/amdgu: remove unused code Jesse Zhang
2024-05-10  6:43   ` Huang, Tim
2024-05-10  2:50 ` [PATCH 15/22] drm/amd/pm: fix enum feature compared against 0 Jesse Zhang
2024-05-10  3:29   ` Wang, Yang(Kevin)
2024-05-10  6:42   ` Huang, Tim
2024-05-10  2:50 ` [PATCH 16/22] drm/amd/pm: fix enum type " Jesse Zhang
2024-05-10  6:45   ` Huang, Tim
2024-05-10  2:50 ` [PATCH 17/22] drm/amdgpu: fix the warning bad bit shift operation for aca_error_type type Jesse Zhang
2024-05-13  2:18   ` Zhang, Jesse(Jie)
2024-05-13  2:53     ` Wang, Yang(Kevin)
2024-05-10  2:50 ` [PATCH 18/22] drm/amd/pm: check negtive return for table entries Jesse Zhang
2024-05-13  2:19   ` Zhang, Jesse(Jie)
2024-05-13  4:06     ` Huang, Tim
2024-05-10  2:50 ` [PATCH 19/22] drm/amdgpu: Fix the warning division or modulo by zero for the variable num_xcc_per_xcp Jesse Zhang
2024-05-10  6:51   ` Huang, Tim
2024-05-10  7:16   ` Lazar, Lijo
2024-05-10  7:39     ` Zhang, Jesse(Jie)
2024-05-10  7:47       ` Lazar, Lijo
2024-05-10  2:50 ` [PATCH 20/22] drm/amd/pm: fix get dpm level count for smu13 Jesse Zhang
2024-05-10  5:43   ` Zhang, Yifan
2024-05-10  2:50 ` [PATCH 21/22] drm/amd/pm: fix get dpm level count for yello carp Jesse Zhang
2024-05-10  5:44   ` Zhang, Yifan
2024-05-10  2:50 ` [PATCH 22/22] drm/amdgpu: clear the warning unsigned compared against 0 for xcp_id Jesse Zhang
2024-05-10  6:52   ` Huang, Tim
2024-05-10  6:05 ` [PATCH 01/22] drm/amdgpu: fix dereference after null check Huang, Tim
2024-05-13 11:41 ` Christian König
2024-05-14  2:39   ` Zhang, Jesse(Jie)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240510025038.3488381-1-jesse.zhang@amd.com \
    --to=jesse.zhang@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Tim.Huang@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).