]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/selftests: Silence compiler warning in igt_ctx_exec
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 23 May 2017 19:44:12 +0000 (20:44 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 24 May 2017 11:01:40 +0000 (12:01 +0100)
commitbe0a4c50290e9f108684c8ec4f487d5f4eb8c488
tree5dcabb774bed7f46c3b8409fc766078ed69ba198
parentd2672fa2f8c5c24527ecc5c63cf86562de0426af
drm/i915/selftests: Silence compiler warning in igt_ctx_exec

The compiler doesn't always spot the guard that object is allocated on
the first pass, leading to:

drivers/gpu/drm/i915/selftests/i915_gem_context.c: warning: 'obj' may be used uninitialized in this function [-Wuninitialized]:  => 370:8

v2: Make it more obvious by setting obj to NULL on the first pass and
any later pass where we need to reallocate.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Fixes: d7ce8ff754bc ("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: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
c: <drm-intel-fixes@lists.freedesktop.org> # v4.12-rc1+
Link: http://patchwork.freedesktop.org/patch/msgid/20170523194412.1195-1-chris@chris-wilson.co.uk
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
drivers/gpu/drm/i915/selftests/i915_gem_context.c