Skip to content

Commit 47caa96

Browse files
Dan Carpenterzhenyw
authored andcommitted
drm/i915/gvt: Fix uninitialized variable in handle_mmio()
This code prints the wrong variable in the warning message. It should print "i" instead of "info->offset". On the first iteration "info" is uninitialized leading to a crash and on subsequent iterations it prints the previous offset instead of the current one. Fixes: e0f74ed ("i915/gvt: Separate the MMIO tracking table from GVT-g") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Zhenyu Wang <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Zhenyu Wang <[email protected]>
1 parent 1a00897 commit 47caa96

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/gpu/drm/i915/gvt/handlers.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2849,8 +2849,7 @@ static int handle_mmio(struct intel_gvt_mmio_table_iter *iter, u32 offset,
28492849
for (i = start; i < end; i += 4) {
28502850
p = intel_gvt_find_mmio_info(gvt, i);
28512851
if (p) {
2852-
WARN(1, "dup mmio definition offset %x\n",
2853-
info->offset);
2852+
WARN(1, "dup mmio definition offset %x\n", i);
28542853

28552854
/* We return -EEXIST here to make GVT-g load fail.
28562855
* So duplicated MMIO can be found as soon as

0 commit comments

Comments
 (0)