[Mesa-dev] [PATCH] nouveau: fix frees in unsupported IR error paths.

Karol Herbst kherbst at redhat.com
Tue Jun 18 21:19:22 UTC 2019


ohh, nvm... I already know...

On Tue, Jun 18, 2019 at 11:18 PM Karol Herbst <kherbst at redhat.com> wrote:
>
> On Tue, Jun 18, 2019 at 11:14 PM Dave Airlie <airlied at gmail.com> wrote:
> >
> > From: Dave Airlie <airlied at redhat.com>
> >
> > This is pointless in that we won't ever hit those paths in real life,
> > but coverity complains.
> >
>
> what does it actually complain about?
>
> > Fixes: f014ae3c7cce ("nouveau: add support for nir")
> > ---
> >  src/gallium/drivers/nouveau/nv50/nv50_program.c | 1 +
> >  src/gallium/drivers/nouveau/nv50/nv50_state.c   | 2 ++
> >  src/gallium/drivers/nouveau/nvc0/nvc0_program.c | 1 +
> >  src/gallium/drivers/nouveau/nvc0/nvc0_state.c   | 2 ++
> >  4 files changed, 6 insertions(+)
> >
> > diff --git a/src/gallium/drivers/nouveau/nv50/nv50_program.c b/src/gallium/drivers/nouveau/nv50/nv50_program.c
> > index 940fb9ce25c..a725aedcd8e 100644
> > --- a/src/gallium/drivers/nouveau/nv50/nv50_program.c
> > +++ b/src/gallium/drivers/nouveau/nv50/nv50_program.c
> > @@ -346,6 +346,7 @@ nv50_program_translate(struct nv50_program *prog, uint16_t chipset,
> >        break;
> >     default:
> >        assert(!"unsupported IR!");
> > +      free(info);
> >        return false;
> >     }
> >
> > diff --git a/src/gallium/drivers/nouveau/nv50/nv50_state.c b/src/gallium/drivers/nouveau/nv50/nv50_state.c
> > index 228feced5d1..89558ee442f 100644
> > --- a/src/gallium/drivers/nouveau/nv50/nv50_state.c
> > +++ b/src/gallium/drivers/nouveau/nv50/nv50_state.c
> > @@ -768,6 +768,7 @@ nv50_sp_state_create(struct pipe_context *pipe,
> >        break;
> >     default:
> >        assert(!"unsupported IR!");
> > +      free(prog);
> >        return NULL;
> >     }
> >
> > @@ -864,6 +865,7 @@ nv50_cp_state_create(struct pipe_context *pipe,
> >        break;
> >     default:
> >        assert(!"unsupported IR!");
> > +      free(prog);
> >        return NULL;
> >     }
> >
> > diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_program.c b/src/gallium/drivers/nouveau/nvc0/nvc0_program.c
> > index c81d8952c98..1ff9f19f139 100644
> > --- a/src/gallium/drivers/nouveau/nvc0/nvc0_program.c
> > +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_program.c
> > @@ -594,6 +594,7 @@ nvc0_program_translate(struct nvc0_program *prog, uint16_t chipset,
> >        break;
> >     default:
> >        assert(!"unsupported IR!");
> > +      free(info);
> >        return false;
> >     }
> >
> > diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
> > index 2ab51c8529e..7c0f605dc16 100644
> > --- a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
> > +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
> > @@ -607,6 +607,7 @@ nvc0_sp_state_create(struct pipe_context *pipe,
> >        break;
> >     default:
> >        assert(!"unsupported IR!");
> > +      free(prog);
> >        return NULL;
> >     }
> >
> > @@ -739,6 +740,7 @@ nvc0_cp_state_create(struct pipe_context *pipe,
> >        break;
> >     default:
> >        assert(!"unsupported IR!");
> > +      free(prog);
> >        return NULL;
> >     }
> >
> > --
> > 2.21.0
> >
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list