Skip to contentSkip to conversation

drm/amdgpu: use ERR_PTR() to return from amdgpu_mn_get

PATCH In review Arnd Bergmann 2 participants 2 messages Apr 28, 2016

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

PATCH 1/1 drm/amdgpu: use ERR_PTR() to return from amdgpu_mn_get

The newly added failure path in amdgpu_mn_get() use the wrong return type:

drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c: In function 'amdgpu_mn_get':
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:237:10: error: return makes pointer from integer without a cast

This adds the necessary ERR_PTR() conversion.

Fixes ad35eee9fb17 ("drm/amdgpu: make amdgpu_mn_get wait for mmap_sem killable")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c +1 -1
index cf90686a50d1..32fa7b7913f7 100644
@@ -234,7 +234,7 @@ static struct amdgpu_mn *amdgpu_mn_get(struct amdgpu_device *adev)
 	mutex_lock(&adev->mn_lock);
 	if (down_write_killable(&mm->mmap_sem)) {
 		mutex_unlock(&adev->mn_lock);
-		return -EINTR;
+		return ERR_PTR(-EINTR);
 	}
 
 	hash_for_each_possible(adev->mn_hash, rmn, node, (unsigned long)mm)
Signature · 6 lines
2.7.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Arnd Bergmann

The newly added failure path in amdgpu_mn_get() use the wrong return type:

drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c: In function 'amdgpu_mn_get':
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:237:10: error: return makes pointer from integer without a cast

This adds the necessary ERR_PTR() conversion.

Fixes ad35eee9fb17 ("drm/amdgpu: make amdgpu_mn_get wait for mmap_sem killable")

This is in the mmotm tree so the sha is unstable.

Thanks for catching this.

Andrew, could you fold this into the original patch please?

Quoted 19 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c +1 -1
index cf90686a50d1..32fa7b7913f7 100644
@@ -234,7 +234,7 @@ static struct amdgpu_mn *amdgpu_mn_get(struct amdgpu_device *adev)
 	mutex_lock(&adev->mn_lock);
 	if (down_write_killable(&mm->mmap_sem)) {
 		mutex_unlock(&adev->mn_lock);
-		return -EINTR;
+		return ERR_PTR(-EINTR);
 	}
 
 	hash_for_each_possible(adev->mn_hash, rmn, node, (unsigned long)mm)
Signature · 1 line
2.7.0
Signature · 2 lines
Michal Hocko
SUSE Labs