Skip to content

Commit

Permalink
drm/i915: Fix an error checking test
Browse files Browse the repository at this point in the history
'dma_buf_vmap' returns NULL on error, not an error pointer.

Fixes: 6cca22e ("drm/i915: Add some mock tests for dmabuf interop")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: http://patchwork.freedesktop.org/patch/msgid/20170627053854.21152-1-christophe.jaillet@wanadoo.fr
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
  • Loading branch information
Christophe JAILLET authored and Chris Wilson committed Jun 27, 2017
1 parent 774eed4 commit 7c3f531
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ static int igt_dmabuf_export_vmap(void *arg)
i915_gem_object_put(obj);

ptr = dma_buf_vmap(dmabuf);
if (IS_ERR(ptr)) {
err = PTR_ERR(ptr);
pr_err("dma_buf_vmap failed with err=%d\n", err);
if (!ptr) {
pr_err("dma_buf_vmap failed\n");
err = -ENOMEM;
goto out;
}

Expand Down

0 comments on commit 7c3f531

Please sign in to comment.