Peter Hutterer
2016-08-15 04:37:01 UTC
Signed-off-by: Peter Hutterer <***@who-t.net>
---
Not 100% why this is triggered, but when devices are added/removed like
crazy (running the libinput test suite with the server trying to pick all of
them up) the parent can sometimes be null.
libwacom/libwacom.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
index 863dc2a..5ab0ab5 100644
--- a/libwacom/libwacom.c
+++ b/libwacom/libwacom.c
@@ -267,6 +267,8 @@ get_device_info (const char *path,
GUdevDevice *parent;
parent = g_udev_device_get_parent (device);
+ if (!parent)
+ goto out;
*name = g_strdup (g_udev_device_get_sysfs_attr (parent, "name"));
g_object_unref (parent);
}
---
Not 100% why this is triggered, but when devices are added/removed like
crazy (running the libinput test suite with the server trying to pick all of
them up) the parent can sometimes be null.
libwacom/libwacom.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
index 863dc2a..5ab0ab5 100644
--- a/libwacom/libwacom.c
+++ b/libwacom/libwacom.c
@@ -267,6 +267,8 @@ get_device_info (const char *path,
GUdevDevice *parent;
parent = g_udev_device_get_parent (device);
+ if (!parent)
+ goto out;
*name = g_strdup (g_udev_device_get_sysfs_attr (parent, "name"));
g_object_unref (parent);
}
--
2.7.4
2.7.4