diff mbox

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

Message ID 20170413195217.GA26108@mwanda (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter April 13, 2017, 7:52 p.m. UTC
i915_gem_request_alloc() uses error pointers.  It never returns NULLs.

Fixes: 0daf0113cff6 ("drm/i915: Mock infrastructure for request emission")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

Chris Wilson April 13, 2017, 8:26 p.m. UTC | #1
On Thu, Apr 13, 2017 at 10:52:17PM +0300, Dan Carpenter wrote:
> i915_gem_request_alloc() uses error pointers.  It never returns NULLs.
> 
> Fixes: 0daf0113cff6 ("drm/i915: Mock infrastructure for request emission")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

Thanks for the catch.
-Chris
Chris Wilson April 13, 2017, 9:17 p.m. UTC | #2
On Thu, Apr 13, 2017 at 09:02:15PM -0000, Patchwork wrote:
> == Series Details ==
> 
> Series: drm/i915: checking for NULL instead of IS_ERR() in mock selftests
> URL   : https://patchwork.freedesktop.org/series/23040/
> State : success
> 
> == Summary ==
> 
> Series 23040v1 drm/i915: checking for NULL instead of IS_ERR() in mock selftests
> https://patchwork.freedesktop.org/api/1.0/series/23040/revisions/1/mbox/

Thanks for the patch, pushed.
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/selftests/mock_request.c b/drivers/gpu/drm/i915/selftests/mock_request.c
index 0e8d2e7f8c70..8097e3693ec4 100644
--- a/drivers/gpu/drm/i915/selftests/mock_request.c
+++ b/drivers/gpu/drm/i915/selftests/mock_request.c
@@ -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);