Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1736219
| From | Zhenyu Wang <zhenyuw@linux.intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly |
| Date | 2017-09-21 01:00 +0200 |
| Message-ID | <urW8h-QH-1@gated-at.bofh.it> (permalink) |
| References | <urt6h-7kk-1@gated-at.bofh.it> <uryIG-2nT-11@gated-at.bofh.it> <urD5E-5dE-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
[Multipart message — attachments visible in raw view] - view raw
On 2017.09.19 19:35:23 -0700, Joe Perches wrote:
> On Wed, 2017-09-20 at 05:46 +0800, Zhenyu Wang wrote:
> > On 2017.09.19 16:55:34 +0100, Colin King wrote:
> > > From: Colin Ian King <colin.king@canonical.com>
> > >
> > > An earlier fix changed the return type from find_bb_size however the
> > > integer return is being assigned to a unsigned int so the -ve error
> > > check will never be detected. Make bb_size an int to fix this.
> > >
> > > Detected by CoverityScan CID#1456886 ("Unsigned compared against 0")
> > >
> > > Fixes: 1e3197d6ad73 ("drm/i915/gvt: Refine error handling for perform_bb_shadow")
> > > Signed-off-by: Colin Ian King <colin.king@canonical.com>
> > > ---
> > > drivers/gpu/drm/i915/gvt/cmd_parser.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.c b/drivers/gpu/drm/i915/gvt/cmd_parser.c
> > > index 2c0ccbb817dc..f41cbf664b69 100644
> > > --- a/drivers/gpu/drm/i915/gvt/cmd_parser.c
> > > +++ b/drivers/gpu/drm/i915/gvt/cmd_parser.c
> > > @@ -1628,7 +1628,7 @@ static int perform_bb_shadow(struct parser_exec_state *s)
> > > struct intel_shadow_bb_entry *entry_obj;
> > > struct intel_vgpu *vgpu = s->vgpu;
> > > unsigned long gma = 0;
> > > - uint32_t bb_size;
> > > + int bb_size;
> > > void *dst = NULL;
> > > int ret = 0;
> > >
> >
> > Applied this, thanks!
>
> Is it possible for bb_size to be both >= 2g and valid?
Never be possible in practise and if really that big I think something
is already insane indeed.
--
Open Source Technology Center, Intel ltd.
$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly Colin King <colin.king@canonical.com> - 2017-09-19 18:00 +0200
Re: [PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly Zhenyu Wang <zhenyuw@linux.intel.com> - 2017-09-20 00:00 +0200
Re: [PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly Joe Perches <joe@perches.com> - 2017-09-20 04:40 +0200
Re: [PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly Zhenyu Wang <zhenyuw@linux.intel.com> - 2017-09-21 01:00 +0200
Re: [PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly Joonas Lahtinen <joonas.lahtinen@linux.intel.com> - 2017-09-21 16:40 +0200
RE: [PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly "Wang, Zhi A" <zhi.a.wang@intel.com> - 2017-09-21 18:20 +0200
Re: [PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly Joonas Lahtinen <joonas.lahtinen@linux.intel.com> - 2017-09-22 13:20 +0200
RE: [PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly "Wang, Zhi A" <zhi.a.wang@intel.com> - 2017-09-22 20:00 +0200
Re: [PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly Joonas Lahtinen <joonas.lahtinen@linux.intel.com> - 2017-09-25 11:40 +0200
csiph-web