Skip to content

Commit

Permalink
fix assert issue with systemd udev
Browse files Browse the repository at this point in the history
  • Loading branch information
heitbaum committed Jun 12, 2024
1 parent bf5a97d commit 898177b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/libcec/adapter/Pulse-Eight/USBCECAdapterDetection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,12 @@ uint8_t CUSBCECAdapterDetection::FindAdaptersUdev(cec_adapter_descriptor *device
if (!dev)
continue;

pdev = udev_device_get_parent(udev_device_get_parent(dev));
// do not call udev_device_get_parent(udev_device_get_parent(dev))
// directly as a null reurn on the parent will cause an assert in
// udev_device_get_parent
pdev = udev_device_get_parent(dev);
if (pdev)
pdev = udev_device_get_parent(pdev);
if (!pdev || !udev_device_get_sysattr_value(pdev, "idVendor") || !udev_device_get_sysattr_value(pdev, "idProduct"))
{
udev_device_unref(dev);
Expand Down

0 comments on commit 898177b

Please sign in to comment.