Skip to contentSkip to conversation

amdkfd: fix some error handling in ioctl

PATCH In review Dan Carpenter 2 participants 2 messages Nov 25, 2014

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

PATCH 1/1 amdkfd: fix some error handling in ioctl

There is a typo here so the errors from kfd_bind_process_to_device() are not detected.

drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +2 -2
index 64c73ba..c5dd0ae 100644
@@ -236,7 +236,7 @@ static long kfd_ioctl_create_queue(struct file *filep, struct kfd_process *p,
 	mutex_lock(&p->mutex);
 
 	pdd = kfd_bind_process_to_device(dev, p);
-	if (IS_ERR(pdd) < 0) {
+	if (IS_ERR(pdd)) {
 		err = PTR_ERR(pdd);
 		goto err_bind_process;
 	}
@@ -381,7 +381,7 @@ static long kfd_ioctl_set_memory_policy(struct file *filep,
 	mutex_lock(&p->mutex);
 
 	pdd = kfd_bind_process_to_device(dev, p);
-	if (IS_ERR(pdd) < 0) {
+	if (IS_ERR(pdd)) {
 		err = PTR_ERR(pdd);
 		goto out;
 	}
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Dan Carpenter

There is a typo here so the errors from kfd_bind_process_to_device() are not detected.

Patch is:

And applied to my 3.19-next-wip tree

Oded

Quoted 23 lines
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +2 -2
index 64c73ba..c5dd0ae 100644
@@ -236,7 +236,7 @@ static long kfd_ioctl_create_queue(struct file *filep, struct kfd_process *p,
  	mutex_lock(&p->mutex);
 
  	pdd = kfd_bind_process_to_device(dev, p);
-	if (IS_ERR(pdd) < 0) {
+	if (IS_ERR(pdd)) {
  		err = PTR_ERR(pdd);
  		goto err_bind_process;
  	}
@@ -381,7 +381,7 @@ static long kfd_ioctl_set_memory_policy(struct file *filep,
  	mutex_lock(&p->mutex);
 
  	pdd = kfd_bind_process_to_device(dev, p);
-	if (IS_ERR(pdd) < 0) {
+	if (IS_ERR(pdd)) {
  		err = PTR_ERR(pdd);
  		goto out;
  	}