drm/amdkfd: CRIU fix a NULL vs IS_ERR() check
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 9 Feb 2022 18:09:27 +0000 (21:09 +0300)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 11 Feb 2022 21:09:26 +0000 (16:09 -0500)
The kfd_process_device_data_by_id() does not return error pointers,
it returns NULL.

Fixes: bef153b70c6e ("drm/amdkfd: CRIU implement gpu_id remapping")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: David Yat Sin <david.yatsin@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c

index 13e4663..8d998aa 100644 (file)
@@ -2252,7 +2252,7 @@ static int criu_restore_bos(struct kfd_process *p,
                                break;
 
                        peer_pdd = kfd_process_device_data_by_id(p, bo_priv->mapped_gpuids[j]);
-                       if (IS_ERR(peer_pdd)) {
+                       if (!peer_pdd) {
                                ret = -EINVAL;
                                goto exit;
                        }