diff options
author | Bastien Nocera <hadess@hadess.net> | 2017-03-24 17:14:06 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2017-03-24 17:14:06 +0100 |
commit | 86e52378072cc052cfd4a004e1faaff23174aaa8 (patch) | |
tree | bf25cb45632f413a76bb794128938d3586fdfdbf | |
parent | a2eecff867b37d3369e5941a88d2b03dda147b95 (diff) | |
download | upower-86e52378072cc052cfd4a004e1faaff23174aaa8.tar.gz |
linux: Fix critical when searching for sibling devices
GUdev-CRITICAL **: g_udev_device_get_sysfs_path: assertion 'G_UDEV_IS_DEVICE (device)' failed
This is caused by looking for devices in a particular subsystem which
don't have parents. This can happen with virtual devices, such as the
ones created by test suites.
-rw-r--r-- | src/linux/up-device-supply.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/linux/up-device-supply.c b/src/linux/up-device-supply.c index f023356..5659bca 100644 --- a/src/linux/up-device-supply.c +++ b/src/linux/up-device-supply.c @@ -932,6 +932,8 @@ up_device_supply_get_sibling_with_subsystem (GUdevDevice *device, const char *p_path; p = g_udev_device_get_parent (d); + if (!p) + continue; p_path = g_udev_device_get_sysfs_path (p); if (g_strcmp0 (p_path, parent_path) == 0) sibling = g_object_ref (d); |