[Mesa-dev] [PATCH 1/7] nvc0: fix crash when nv50_miptree_from_handle fails

Julien Isorce julien.isorce at gmail.com
Mon Oct 19 15:36:23 PDT 2015


Thx for the review. I experienced the crash when testing patch 5/7 of this
patch series, around "resource = pscreen->resource_from_handle" in the new
vaCreateSurface2 function.
Julien

On 19 October 2015 at 16:59, Emil Velikov <emil.l.velikov at gmail.com> wrote:

> On 17 October 2015 at 00:14, Julien Isorce <julien.isorce at gmail.com>
> wrote:
> > Signed-off-by: Julien Isorce <j.isorce at samsung.com>
> > ---
> >  src/gallium/drivers/nouveau/nvc0/nvc0_resource.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_resource.c
> b/src/gallium/drivers/nouveau/nvc0/nvc0_resource.c
> > index 12b5a02..15c803c 100644
> > --- a/src/gallium/drivers/nouveau/nvc0/nvc0_resource.c
> > +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_resource.c
> > @@ -26,7 +26,8 @@ nvc0_resource_from_handle(struct pipe_screen * screen,
> >     } else {
> >        struct pipe_resource *res = nv50_miptree_from_handle(screen,
> >                                                             templ,
> whandle);
> > -      nv04_resource(res)->vtbl = &nvc0_miptree_vtbl;
> > +      if (res)
> > +         nv04_resource(res)->vtbl = &nvc0_miptree_vtbl;
> Did you actually experience the crash or did you notice this while
> browsing through ?
>
> Either way - abeit unlikely we can return NULL, so let's avoid the crash.
> Cc: "11.0" <mesa-stable at lists.freedesktop.org>
> Reviewed-by: Emil Velikov <emil.l.velikov at gmail.com>
>
> Thanks
> Emil
> g
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20151019/4a2a739b/attachment.html>


More information about the mesa-dev mailing list