[PATCH evemu 1/7] Ignore NULL in evemu_destroy()

Benjamin Tissoires benjamin.tissoires at gmail.com
Tue Aug 18 18:08:52 PDT 2015


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???)

Cheers,
Benjamin

>  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