Skip to content

Commit 5b440a8

Browse files
ColinIanKinglucasdemarchi
authored andcommitted
drm/xe/xe_late_bind_fw: Fix missing initialization of variable offset
The variable offset is not being initialized, and it is only set inside a for-loop if entry->name is the same as manifest_entry. In the case where it is not initialized a non-zero check on offset is potentialy checking a bogus uninitalized value. Fix this by initializing offset to zero. Fixes: efa2931 ("drm/xe/xe_late_bind_fw: Extract and print version info") Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Reviewed-by: Badal Nilawar <badal.nilawar@intel.com> Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com> Link: https://lore.kernel.org/r/20250924102208.9216-1-colin.i.king@gmail.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> (cherry picked from commit 20f3b28e2e07747fd27301f0f5deb3cb569ee15c) Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
1 parent 17f6f6f commit 5b440a8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/xe/xe_late_bind_fw.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static int parse_cpd_header(struct xe_late_bind_fw *lb_fw,
6060
const struct gsc_manifest_header *manifest;
6161
const struct gsc_cpd_entry *entry;
6262
size_t min_size = sizeof(*header);
63-
u32 offset;
63+
u32 offset = 0;
6464
int i;
6565

6666
/* manifest_entry is mandatory */
@@ -116,7 +116,7 @@ static int parse_lb_layout(struct xe_late_bind_fw *lb_fw,
116116
const struct csc_fpt_header *header = data;
117117
const struct csc_fpt_entry *entry;
118118
size_t min_size = sizeof(*header);
119-
u32 offset;
119+
u32 offset = 0;
120120
int i;
121121

122122
/* fpt_entry is mandatory */

0 commit comments

Comments
 (0)