aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vetter <[email protected]>2013-07-02 09:18:39 +0200
committerDave Airlie <[email protected]>2013-07-04 09:58:55 +1000
commit4a88f73f14f6d6c94616538427e1235a6d0a5885 (patch)
treece70dad0788157dad0ac832bfd861cee117243e7
parent77ef8bbc87be7ad10b410247efc6d0f10676b401 (diff)
drm/prime: fix up handle_to_fd ioctl return value
In commit da34242e5e0638312130f5bd5d2d277afbc6f806 Author: YoungJun Cho <[email protected]> Date: Wed Jun 26 10:21:42 2013 +0900 drm/prime: add return check for dma_buf_fd the failure case handling was fixed up. But in the case when we already had the buffer exported it changed the return value: Previously we've return 0 on success, now we return the fd. This ABI change has been caught by i-g-t/prime_self_import/with_one_bo. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66436 Cc: YoungJun Cho <[email protected]> Cc: Seung-Woo Kim <[email protected]> Cc: Kyungmin Park <[email protected]> Tested-by: lu hua <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Reviewed-by: YoungJun Cho <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
-rw-r--r--drivers/gpu/drm/drm_prime.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
index 52709f2171fb..1e0de41f085c 100644
--- a/drivers/gpu/drm/drm_prime.c
+++ b/drivers/gpu/drm/drm_prime.c
@@ -347,10 +347,13 @@ int drm_gem_prime_handle_to_fd(struct drm_device *dev,
out_have_obj:
get_dma_buf(dmabuf);
ret = dma_buf_fd(dmabuf, flags);
- if (ret < 0)
+ if (ret < 0) {
dma_buf_put(dmabuf);
- else
+ } else {
*prime_fd = ret;
+ ret = 0;
+ }
+
goto out;
fail_rm_handle: