Skip to content

Commit 64da63c

Browse files
mwajdeczrodrigovivi
authored andcommitted
drm/xe/vf: Fix register value lookup
We should use the number of actual entries stored in the runtime register buffer, not the maximum number of entries that this buffer can hold, otherwise bsearch() may fail and we may miss the data and wrongly report unexpected access to some registers. Fixes: 4edadc4 ("drm/xe/vf: Use register values obtained from the PF") Signed-off-by: Michal Wajdeczko <[email protected]> Cc: Piotr Piórkowski <[email protected]> Cc: Matt Roper <[email protected]> Reviewed-by: Matt Roper <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit ad16682) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 817c70e commit 64da63c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/xe/xe_gt_sriov_vf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ static struct vf_runtime_reg *vf_lookup_reg(struct xe_gt *gt, u32 addr)
850850

851851
xe_gt_assert(gt, IS_SRIOV_VF(gt_to_xe(gt)));
852852

853-
return bsearch(&key, runtime->regs, runtime->regs_size, sizeof(key),
853+
return bsearch(&key, runtime->regs, runtime->num_regs, sizeof(key),
854854
vf_runtime_reg_cmp);
855855
}
856856

0 commit comments

Comments
 (0)