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>
(cherry picked from commit be02f75)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
  • Loading branch information
Dan Carpenter authored and Jani Nikula committed Apr 26, 2017
1 parent dea6559 commit 5af9e67
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 5af9e67

Please sign in to comment.