Skip to content

Commit 0f9d36a

Browse files
mbrost05jnikula
authored andcommitted
drm/i915: Fix possible uninitialized variable in parallel extension
'prev_engine' was declared inside the output loop and checked in the inner after at least 1 pass of either loop. The variable should be declared outside both loops as it needs to be persistent across the entire loop structure. Fixes: e5e3217 ("drm/i915/guc: Connect UAPI to GuC multi-lrc interface") Signed-off-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20211219001909.24348-1-matthew.brost@intel.com (cherry picked from commit cbffbac) Signed-off-by: Jani Nikula <jani.nikula@intel.com>
1 parent fc74e0a commit 0f9d36a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/i915/gem/i915_gem_context.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,7 @@ set_proto_ctx_engines_parallel_submit(struct i915_user_extension __user *base,
564564
container_of_user(base, typeof(*ext), base);
565565
const struct set_proto_ctx_engines *set = data;
566566
struct drm_i915_private *i915 = set->i915;
567+
struct i915_engine_class_instance prev_engine;
567568
u64 flags;
568569
int err = 0, n, i, j;
569570
u16 slot, width, num_siblings;
@@ -629,7 +630,6 @@ set_proto_ctx_engines_parallel_submit(struct i915_user_extension __user *base,
629630
/* Create contexts / engines */
630631
for (i = 0; i < width; ++i) {
631632
intel_engine_mask_t current_mask = 0;
632-
struct i915_engine_class_instance prev_engine;
633633

634634
for (j = 0; j < num_siblings; ++j) {
635635
struct i915_engine_class_instance ci;

0 commit comments

Comments
 (0)