Skip to contentSkip to conversation

drm/amdgpu: only set dma_buf ops when it is valid

PATCH In review Samuel Li 2 participants 2 messages Jan 12, 2018 – Jan 13, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Samuel Li

author
#0 lore raw

PATCH 1/1 drm/amdgpu: only set dma_buf ops when it is valid

Change-Id: I37daecbf695da13eaeea1d362c270b92a894393a

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c +3 -2
index a14234b..8afec21 100644
@@ -221,9 +221,10 @@ struct dma_buf *amdgpu_gem_prime_export(struct drm_device *dev,
 		return ERR_PTR(-EPERM);
 
 	buf = drm_gem_prime_export(dev, gobj, flags);
-	if (!IS_ERR(buf))
+	if (!IS_ERR(buf)) {
 		buf->file->f_mapping = dev->anon_inode->i_mapping;
-	buf->ops = &amdgpu_dmabuf_ops;
+		buf->ops = &amdgpu_dmabuf_ops;
+	}
 
 	return buf;
 }
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1515798111-28959-1-git-send-email-Samuel.Li-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Commit message and signed-of-by line is missing.

Apart from that the patch is Reviewed-by: Christian König <[email protected]>.

Regards,
Christian.

Am 13.01.2018 um 00:01 schrieb Samuel Li:

Quoted 12 lines

Change-Id: I37daecbf695da13eaeea1d362c270b92a894393a

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c +0 -0
index a14234b..8afec21 100644
@@ -221,9 +221,10 @@ struct dma_buf *amdgpu_gem_prime_export(struct drm_device *dev,
  		return ERR_PTR(-EPERM);
 

drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c struct dma_buf *amdgpu_gem_prime_export(struct drm_device *dev, · line 230

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c +3 -2
  	buf = drm_gem_prime_export(dev, gobj, flags);
-	if (!IS_ERR(buf))
+	if (!IS_ERR(buf)) {
  		buf->file->f_mapping = dev->anon_inode->i_mapping;
-	buf->ops = &amdgpu_dmabuf_ops;
+		buf->ops = &amdgpu_dmabuf_ops;
+	}
 
  	return buf;
  }

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx