Skip to content

Commit

Permalink
drm/i915: checking for NULL instead of IS_ERR() in mock selftests
Browse files Browse the repository at this point in the history
i915_gem_request_alloc() uses error pointers.  It never returns NULLs.

Fixes: 0daf011 ("drm/i915: Mock infrastructure for request emission")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170413195217.GA26108@mwanda
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
  • Loading branch information
Dan Carpenter authored and Chris Wilson committed Apr 13, 2017
1 parent 9301397 commit be02f75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/selftests/mock_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ mock_request(struct intel_engine_cs *engine,

/* NB the i915->requests slab cache is enlarged to fit mock_request */
request = i915_gem_request_alloc(engine, context);
if (!request)
if (IS_ERR(request))
return NULL;

mock = container_of(request, typeof(*mock), base);
Expand Down

0 comments on commit be02f75

Please sign in to comment.