touchpad: fix a clang compiler warning
authorPeter Hutterer <peter.hutterer@who-t.net>
Mon, 5 Jan 2015 23:34:06 +0000 (09:34 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Mon, 5 Jan 2015 23:53:30 +0000 (09:53 +1000)
Causes the valgrind tests to fail as tp is considered uninitialized.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/evdev-mt-touchpad-tap.c

index c34b203..0e37c5e 100644 (file)
@@ -664,8 +664,9 @@ tp_tap_config_set_enabled(struct libinput_device *device,
                          enum libinput_config_tap_state enabled)
 {
        struct evdev_dispatch *dispatch = ((struct evdev_device *) device)->dispatch;
-       struct tp_dispatch *tp = container_of(dispatch, tp, base);
+       struct tp_dispatch *tp = NULL;
 
+       tp = container_of(dispatch, tp, base);
        tp_tap_enabled_update(tp, tp->tap.suspended,
                              (enabled == LIBINPUT_CONFIG_TAP_ENABLED),
                              libinput_now(device->seat->libinput));