From 00a8bcea2fa360f18380b96d1b440c9203697d4a Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 24 Nov 2023 14:52:23 +0000 Subject: [PATCH] 5.4-stable patches added patches: drm-amdgpu-fix-error-handling-in-amdgpu_bo_list_get.patch --- ...error-handling-in-amdgpu_bo_list_get.patch | 35 +++++++++++++++++++ queue-5.4/series | 1 + 2 files changed, 36 insertions(+) create mode 100644 queue-5.4/drm-amdgpu-fix-error-handling-in-amdgpu_bo_list_get.patch diff --git a/queue-5.4/drm-amdgpu-fix-error-handling-in-amdgpu_bo_list_get.patch b/queue-5.4/drm-amdgpu-fix-error-handling-in-amdgpu_bo_list_get.patch new file mode 100644 index 00000000000..2381dcb4864 --- /dev/null +++ b/queue-5.4/drm-amdgpu-fix-error-handling-in-amdgpu_bo_list_get.patch @@ -0,0 +1,35 @@ +From 12f76050d8d4d10dab96333656b821bd4620d103 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Christian=20K=C3=B6nig?= +Date: Thu, 9 Nov 2023 10:12:39 +0100 +Subject: drm/amdgpu: fix error handling in amdgpu_bo_list_get() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Christian König + +commit 12f76050d8d4d10dab96333656b821bd4620d103 upstream. + +We should not leak the pointer where we couldn't grab the reference +on to the caller because it can be that the error handling still +tries to put the reference then. + +Signed-off-by: Christian König +Reviewed-by: Alex Deucher +Signed-off-by: Alex Deucher +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c +@@ -178,6 +178,7 @@ int amdgpu_bo_list_get(struct amdgpu_fpr + } + + rcu_read_unlock(); ++ *result = NULL; + return -ENOENT; + } + diff --git a/queue-5.4/series b/queue-5.4/series index bd304716c72..8430125973b 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -129,3 +129,4 @@ ext4-correct-offset-of-gdb-backup-in-non-meta_bg-group-to-update_backups.patch ext4-correct-return-value-of-ext4_convert_meta_bg.patch ext4-correct-the-start-block-of-counting-reserved-clusters.patch ext4-remove-gdb-backup-copy-for-meta-bg-in-setup_new_flex_group_blocks.patch +drm-amdgpu-fix-error-handling-in-amdgpu_bo_list_get.patch -- 2.47.3