Skip to contentSkip to conversation

drm/amdkfd: CRIU fix a NULL vs IS_ERR() check

PATCH New Dan Carpenter 1 participant 1 message Feb 9, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdkfd: CRIU fix a NULL vs IS_ERR() check

The kfd_process_device_data_by_id() does not return error pointers, it returns NULL.

Fixes bef153b70c6e ("drm/amdkfd: CRIU implement gpu_id remapping")
---
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +1 -1
index 64e3b4e3a712..75aca99f6ece 100644
@@ -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;
 			}
Signature · 1 line
2.20.1