mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-04-05 10:10:41 +02:00
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.
This commit is contained in:
parent
a2eecff867
commit
86e5237807
1 changed files with 2 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue