]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amdkfd: fix NULL pointer bug in svm_range_set_attr
authorEric Huang <jinhuieric.huang@amd.com>
Thu, 7 May 2026 19:51:49 +0000 (15:51 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 27 May 2026 15:57:49 +0000 (11:57 -0400)
The process_info could be NULL if user doesn't call kfd_ioctl_acquire_vm
before calling kfd_ioctl_svm.

Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 83a26c812e0529eb040d31a76f73e33e637243d4)
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/amdkfd/kfd_svm.c

index 35ec67d9739bdd72bda911e8a8345947fcc53e99..3841943da5ece6c2bd060ff2f0e05429e64f346f 100644 (file)
@@ -3732,6 +3732,9 @@ svm_range_set_attr(struct kfd_process *p, struct mm_struct *mm,
 
        svms = &p->svms;
 
+       if (!process_info)
+               return -EINVAL;
+
        mutex_lock(&process_info->lock);
 
        svm_range_list_lock_and_flush_work(svms, mm);