* [PATCH] drm/i915/gvt: Fix an error code in ppgtt_populate_spt_by_guest_entry()
@ 2019-05-13 9:22 Dan Carpenter
2019-05-14 6:56 ` Zhenyu Wang
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2019-05-13 9:22 UTC (permalink / raw)
To: Zhenyu Wang, Aleksei Gimbitskii
Cc: David Airlie, intel-gfx, kernel-janitors, intel-gvt-dev
"ret" is uninitialized on this path but it should be -EINVAL.
Fixes: 930c8dfea4b8 ("drm/i915/gvt: Check if get_next_pt_type() always returns a valid value")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/gpu/drm/i915/gvt/gtt.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/gvt/gtt.c b/drivers/gpu/drm/i915/gvt/gtt.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 = get_next_pt_type(we->type);
- if (!gtt_type_is_pt(type))
+ if (!gtt_type_is_pt(type)) {
+ ret = -EINVAL;
goto err;
+ }
spt = ppgtt_alloc_spt_gfn(vgpu, type, ops->get_pfn(we), ips);
if (IS_ERR(spt)) {
--
2.18.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/i915/gvt: Fix an error code in ppgtt_populate_spt_by_guest_entry()
2019-05-13 9:22 [PATCH] drm/i915/gvt: Fix an error code in ppgtt_populate_spt_by_guest_entry() Dan Carpenter
@ 2019-05-14 6:56 ` Zhenyu Wang
0 siblings, 0 replies; 2+ messages in thread
From: Zhenyu Wang @ 2019-05-14 6:56 UTC (permalink / raw)
To: Dan Carpenter
Cc: David Airlie, Aleksei Gimbitskii, intel-gfx, kernel-janitors,
intel-gvt-dev
[-- Attachment #1: Type: text/plain, Size: 1100 bytes --]
On 2019.05.13 12:22:44 +0300, Dan Carpenter wrote:
> "ret" is uninitialized on this path but it should be -EINVAL.
>
> Fixes: 930c8dfea4b8 ("drm/i915/gvt: Check if get_next_pt_type() always returns a valid value")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> drivers/gpu/drm/i915/gvt/gtt.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/gvt/gtt.c b/drivers/gpu/drm/i915/gvt/gtt.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 = get_next_pt_type(we->type);
>
> - if (!gtt_type_is_pt(type))
> + if (!gtt_type_is_pt(type)) {
> + ret = -EINVAL;
> goto err;
> + }
>
> spt = ppgtt_alloc_spt_gfn(vgpu, type, ops->get_pfn(we), ips);
> if (IS_ERR(spt)) {
> --
Applied this, thanks!
--
Open Source Technology Center, Intel ltd.
$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-05-14 6:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-13 9:22 [PATCH] drm/i915/gvt: Fix an error code in ppgtt_populate_spt_by_guest_entry() Dan Carpenter
2019-05-14 6:56 ` Zhenyu Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox