Commit 5af9e672 authored by Dan Carpenter's avatar Dan Carpenter Committed by Jani Nikula

drm/i915: checking for NULL instead of IS_ERR() in mock selftests

i915_gem_request_alloc() uses error pointers.  It never returns NULLs.

Fixes: 0daf0113 ("drm/i915: Mock infrastructure for request emission")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170413195217.GA26108@mwandaReviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
(cherry picked from commit be02f755)
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent dea65593
...@@ -35,7 +35,7 @@ mock_request(struct intel_engine_cs *engine, ...@@ -35,7 +35,7 @@ mock_request(struct intel_engine_cs *engine,
/* NB the i915->requests slab cache is enlarged to fit mock_request */ /* NB the i915->requests slab cache is enlarged to fit mock_request */
request = i915_gem_request_alloc(engine, context); request = i915_gem_request_alloc(engine, context);
if (!request) if (IS_ERR(request))
return NULL; return NULL;
mock = container_of(request, typeof(*mock), base); mock = container_of(request, typeof(*mock), base);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment