[PATCH evemu 1/7] Ignore NULL in evemu_destroy()
Peter Hutterer
peter.hutterer at who-t.net
Tue Aug 18 21:31:58 PDT 2015
On Tue, Aug 18, 2015 at 09:08:52PM -0400, Benjamin Tissoires wrote:
> On Tue, Aug 18, 2015 at 9:03 PM, Peter Hutterer
> <peter.hutterer at who-t.net> wrote:
> > Makes the cleanup path nicer and stops coverity warnings. The tools all call
> > evemu_destroy() unconditionally, even when evemu_create() failed.
> >
> > Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> > ---
>
> After a very quick look at the series, everything seems good. Feel
> free to push with my rev-by.
>
> And thanks for spotting the nasty missing break (how could we never
> noticed that???)
that too was spotted by coverity, I almost considered it a false positive :)
Cheers,
Peter
> > src/evemu.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/src/evemu.c b/src/evemu.c
> > index 0887ed1..b64f6f0 100644
> > --- a/src/evemu.c
> > +++ b/src/evemu.c
> > @@ -139,6 +139,9 @@ struct evemu_device *evemu_new(const char *name)
> >
> > void evemu_delete(struct evemu_device *dev)
> > {
> > + if (dev == NULL)
> > + return;
> > +
> > if (dev->uidev)
> > evemu_destroy(dev);
> > libevdev_free(dev->evdev);
> > --
> > 2.4.3
> >
> > _______________________________________________
> > Input-tools mailing list
> > Input-tools at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/input-tools
More information about the Input-tools
mailing list