public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: drm-intel-fixes@lists.freedesktop.org,
	Matthew Auld <matthew.auld@intel.com>,
	Mika Kuoppala <mika.kuoppala@intel.com>
Subject: Re: [PATCH] drm/i915/selftests: Catch error from mock_file()
Date: Mon, 13 Mar 2017 12:54:15 +0000	[thread overview]
Message-ID: <7f08462b-debe-015c-649b-6b2f578c2db5@linux.intel.com> (raw)
In-Reply-To: <20170313124724.10614-1-chris@chris-wilson.co.uk>


On 13/03/2017 12:47, Chris Wilson wrote:
> The patch 791ff39ae32a: "drm/i915: Live testing for context
> execution" from Feb 13, 2017, leads to the following static checker
> warning:
>
>         drivers/gpu/drm/i915/selftests/i915_gem_context.c:347 igt_ctx_exec()
>         error: 'file' dereferencing possible ERR_PTR()
>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Fixes: 791ff39ae32a ("drm/i915: Live testing for context execution")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Matthew Auld <matthew.auld@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> Cc: <drm-intel-fixes@lists.freedesktop.org>
> ---
>  drivers/gpu/drm/i915/selftests/i915_gem_context.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_context.c b/drivers/gpu/drm/i915/selftests/i915_gem_context.c
> index 3813a19a6179..1afb8b06e3e1 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_gem_context.c
> @@ -320,8 +320,8 @@ static unsigned long max_dwords(struct drm_i915_gem_object *obj)
>  static int igt_ctx_exec(void *arg)
>  {
>  	struct drm_i915_private *i915 = arg;
> -	struct drm_file *file = mock_file(i915);
>  	struct drm_i915_gem_object *obj;
> +	struct drm_file *file;
>  	IGT_TIMEOUT(end_time);
>  	LIST_HEAD(objects);
>  	unsigned long ncontexts, ndwords, dw;
> @@ -333,6 +333,10 @@ static int igt_ctx_exec(void *arg)
>  	 * up in the expected pages of our obj.
>  	 */
>
> +	file = mock_file(i915);
> +	if (IS_ERR(file))
> +		return PTR_ERR(file);
> +
>  	mutex_lock(&i915->drm.struct_mutex);
>
>  	ncontexts = 0;
>

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-03-13 12:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-13 12:47 [PATCH] drm/i915/selftests: Catch error from mock_file() Chris Wilson
2017-03-13 12:54 ` Tvrtko Ursulin [this message]
2017-03-13 14:29   ` Chris Wilson
2017-03-13 13:17 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-03-15 13:20 ` [PATCH] " Joonas Lahtinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7f08462b-debe-015c-649b-6b2f578c2db5@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=drm-intel-fixes@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.auld@intel.com \
    --cc=mika.kuoppala@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox