public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: checking for NULL instead of IS_ERR() in mock selftests
@ 2017-04-13 19:52 Dan Carpenter
  2017-04-13 20:26 ` Chris Wilson
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-04-13 19:52 UTC (permalink / raw)
  To: Daniel Vetter, Chris Wilson
  Cc: dri-devel, Arnd Bergmann, Tvrtko Ursulin, intel-gfx,
	Joonas Lahtinen, kernel-janitors, Matthew Auld

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>

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);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/i915: checking for NULL instead of IS_ERR() in mock selftests
  2017-04-13 19:52 [PATCH] drm/i915: checking for NULL instead of IS_ERR() in mock selftests Dan Carpenter
@ 2017-04-13 20:26 ` Chris Wilson
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Wilson @ 2017-04-13 20:26 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Daniel Vetter, Jani Nikula, David Airlie, Tvrtko Ursulin,
	Joonas Lahtinen, Matthew Auld, Arnd Bergmann, intel-gfx,
	dri-devel, kernel-janitors

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, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-13 20:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-13 19:52 [PATCH] drm/i915: checking for NULL instead of IS_ERR() in mock selftests Dan Carpenter
2017-04-13 20:26 ` Chris Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox