Skip to contentSkip to conversation

drm/amdgpu: Fix a deadlock if previous GEM object allocation fails

PATCH Superseded Pan, Xinhui 2 participants 2 messages Aug 31, 2021

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drm/amdgpu: Fix a deadlock if previous GEM object allocation fails

Fall through to handle the error instead of return.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +0 -1
index 85b292ed5c43..7ddd429052ea 100644
@@ -355,7 +355,6 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
 			DRM_DEBUG("Failed to allocate GEM object (%llu, %d, %llu, %d)\n",
 				  size, initial_domain, args->in.alignment, r);
 		}
-		return r;
 	}
 
 	if (flags & AMDGPU_GEM_CREATE_VM_ALWAYS_VALID) {
Signature · 1 line
2.25.1
maintainer
#1 lore raw

Am 31.08.21 um 07:55 schrieb Pan, Xinhui:

Quoted 1 line

Fall through to handle the error instead of return.

Can you also clean up the "if (r) {.. if (r !=..." above?

And please figure out which patch introduced the problem and add a Fixes: tag and maybe CC: stable as well.

Thanks for the help,
Christian.

Quoted 18 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 1 -
  1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +0 -1
index 85b292ed5c43..7ddd429052ea 100644
@@ -355,7 +355,6 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
  			DRM_DEBUG("Failed to allocate GEM object (%llu, %d, %llu, %d)\n",
  				  size, initial_domain, args->in.alignment, r);
  		}
-		return r;
  	}
 
  	if (flags & AMDGPU_GEM_CREATE_VM_ALWAYS_VALID) {