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@xxxxxxxxxx> --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c index 64e3b4e3a712..75aca99f6ece 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c @@ -2526,7 +2526,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; } -- 2.20.1