intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Zhenyu Wang <zhenyuw@linux.intel.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: intel-gvt-dev@lists.freedesktop.org,
	intel-gfx@lists.freedesktop.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	Daniel Vetter <daniel@ffwll.ch>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	David Airlie <airlied@gmail.com>
Subject: Re: [PATCH] drm/i915/gvt: Fix uninitialized variable in handle_mmio()
Date: Mon, 29 Jan 2024 11:37:12 +0800	[thread overview]
Message-ID: <ZbcdaBVJeKLqaKNR@debian-scheme> (raw)
In-Reply-To: <11957c20-b178-4027-9b0a-e32e9591dd7c@moroto.mountain>

[-- Attachment #1: Type: text/plain, Size: 1344 bytes --]

On 2024.01.26 11:41:47 +0300, Dan Carpenter wrote:
> 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: e0f74ed4634d ("i915/gvt: Separate the MMIO tracking table from GVT-g")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>  drivers/gpu/drm/i915/gvt/handlers.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/handlers.c b/drivers/gpu/drm/i915/gvt/handlers.c
> index 90f6c1ece57d..efcb00472be2 100644
> --- a/drivers/gpu/drm/i915/gvt/handlers.c
> +++ b/drivers/gpu/drm/i915/gvt/handlers.c
> @@ -2849,8 +2849,7 @@ static int handle_mmio(struct intel_gvt_mmio_table_iter *iter, u32 offset,
>  	for (i = start; i < end; i += 4) {
>  		p = intel_gvt_find_mmio_info(gvt, i);
>  		if (p) {
> -			WARN(1, "dup mmio definition offset %x\n",
> -				info->offset);
> +			WARN(1, "dup mmio definition offset %x\n", i);
>  
>  			/* We return -EEXIST here to make GVT-g load fail.
>  			 * So duplicated MMIO can be found as soon as
> -- 
> 2.43.0
>

Thanks for the fix.

Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

      parent reply	other threads:[~2024-01-29  3:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-26  8:41 [PATCH] drm/i915/gvt: Fix uninitialized variable in handle_mmio() Dan Carpenter
2024-01-26  9:34 ` ✗ Fi.CI.BAT: failure for " Patchwork
2024-01-29  3:37 ` Zhenyu Wang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZbcdaBVJeKLqaKNR@debian-scheme \
    --to=zhenyuw@linux.intel.com \
    --cc=airlied@gmail.com \
    --cc=dan.carpenter@linaro.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-gvt-dev@lists.freedesktop.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rodrigo.vivi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).