mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
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: e5e32171a2
("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
This commit is contained in:
parent
c3c2ac4c77
commit
cbffbac9c1
@ -564,6 +564,7 @@ set_proto_ctx_engines_parallel_submit(struct i915_user_extension __user *base,
|
|||||||
container_of_user(base, typeof(*ext), base);
|
container_of_user(base, typeof(*ext), base);
|
||||||
const struct set_proto_ctx_engines *set = data;
|
const struct set_proto_ctx_engines *set = data;
|
||||||
struct drm_i915_private *i915 = set->i915;
|
struct drm_i915_private *i915 = set->i915;
|
||||||
|
struct i915_engine_class_instance prev_engine;
|
||||||
u64 flags;
|
u64 flags;
|
||||||
int err = 0, n, i, j;
|
int err = 0, n, i, j;
|
||||||
u16 slot, width, num_siblings;
|
u16 slot, width, num_siblings;
|
||||||
@ -632,7 +633,6 @@ set_proto_ctx_engines_parallel_submit(struct i915_user_extension __user *base,
|
|||||||
/* Create contexts / engines */
|
/* Create contexts / engines */
|
||||||
for (i = 0; i < width; ++i) {
|
for (i = 0; i < width; ++i) {
|
||||||
intel_engine_mask_t current_mask = 0;
|
intel_engine_mask_t current_mask = 0;
|
||||||
struct i915_engine_class_instance prev_engine;
|
|
||||||
|
|
||||||
for (j = 0; j < num_siblings; ++j) {
|
for (j = 0; j < num_siblings; ++j) {
|
||||||
struct i915_engine_class_instance ci;
|
struct i915_engine_class_instance ci;
|
||||||
|
Loading…
Reference in New Issue
Block a user