[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <161156789392.31416.7341729779003502151@build.alporthouse.com>
Date: Mon, 25 Jan 2021 09:44:53 +0000
From: Chris Wilson <chris@...is-wilson.co.uk>
To: Dan Carpenter <dan.carpenter@...cle.com>,
Zhenyu Wang <zhenyuw@...ux.intel.com>
Cc: Yan Zhao <yan.y.zhao@...el.com>, David Airlie <airlied@...ux.ie>,
intel-gfx@...ts.freedesktop.org, kernel-janitors@...r.kernel.org,
linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
Rodrigo Vivi <rodrigo.vivi@...el.com>,
intel-gvt-dev@...ts.freedesktop.org,
Zhi Wang <zhi.a.wang@...el.com>
Subject: Re: [PATCH] drm/i915/gvt: fix uninitialized return in intel_gvt_update_reg_whitelist()
Quoting Dan Carpenter (2021-01-25 08:48:30)
> Smatch found an uninitialized variable bug in this code:
>
> drivers/gpu/drm/i915/gvt/cmd_parser.c:3191 intel_gvt_update_reg_whitelist()
> error: uninitialized symbol 'ret'.
>
> The first thing that Smatch complains about is that "ret" isn't set if
> we don't enter the "for_each_engine(engine, &dev_priv->gt, id) {" loop.
> Presumably we always have at least one engine so that's a false
> positive.
>
> But it's definitely a bug to not set "ret" if i915_gem_object_pin_map()
> fails.
True.
> Let's fix the bug and silence the false positive.
>
> Fixes: 493f30cd086e ("drm/i915/gvt: parse init context to update cmd accessible reg whitelist")
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
Reviewed-by: Chris Wilson <chris@...is-wilson.co.uk>
-Chris
Powered by blists - more mailing lists