From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zhenyu Wang Subject: Re: [PATCH] drm/i915/gvt: Fix an error code in ppgtt_populate_spt_by_guest_entry() Date: Tue, 14 May 2019 14:56:26 +0800 Message-ID: <20190514065626.GK12913@zhen-hp.sh.intel.com> References: <20190513092244.GA12077@mwanda> Reply-To: Zhenyu Wang Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2072028741==" Return-path: In-Reply-To: <20190513092244.GA12077@mwanda> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Dan Carpenter Cc: David Airlie , Aleksei Gimbitskii , intel-gfx@lists.freedesktop.org, kernel-janitors@vger.kernel.org, intel-gvt-dev@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============2072028741== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/Q1T9Q8JmUrFqdou" Content-Disposition: inline --/Q1T9Q8JmUrFqdou Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2019.05.13 12:22:44 +0300, Dan Carpenter wrote: > "ret" is uninitialized on this path but it should be -EINVAL. >=20 > Fixes: 930c8dfea4b8 ("drm/i915/gvt: Check if get_next_pt_type() always re= turns a valid value") > Signed-off-by: Dan Carpenter > --- > drivers/gpu/drm/i915/gvt/gtt.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/gpu/drm/i915/gvt/gtt.c b/drivers/gpu/drm/i915/gvt/gt= t.c > index 08c74e65836b..244ad1729764 100644 > --- a/drivers/gpu/drm/i915/gvt/gtt.c > +++ b/drivers/gpu/drm/i915/gvt/gtt.c > @@ -1076,8 +1076,10 @@ static struct intel_vgpu_ppgtt_spt *ppgtt_populate= _spt_by_guest_entry( > } else { > int type =3D get_next_pt_type(we->type); > =20 > - if (!gtt_type_is_pt(type)) > + if (!gtt_type_is_pt(type)) { > + ret =3D -EINVAL; > goto err; > + } > =20 > spt =3D ppgtt_alloc_spt_gfn(vgpu, type, ops->get_pfn(we), ips); > if (IS_ERR(spt)) { > --=20 Applied this, thanks! --=20 Open Source Technology Center, Intel ltd. $gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827 --/Q1T9Q8JmUrFqdou Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQTXuabgHDW6LPt9CICxBBozTXgYJwUCXNpmmgAKCRCxBBozTXgY J8PrAJ9hmMJUVJA/WcxFVYDp5dmrCIWThACfXEUodqTtaZAUTakJt7C3vBzTioI= =FjA+ -----END PGP SIGNATURE----- --/Q1T9Q8JmUrFqdou-- --===============2072028741== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4 --===============2072028741==--