Skip to content

Commit

Permalink
Merge branch 'evdev' into 'mer-5.6'
Browse files Browse the repository at this point in the history
Always unref udev_device produced by udev_monitor_receive_device

See merge request !28
  • Loading branch information
Slava Monich committed Sep 25, 2017
2 parents 9d649d4 + 312a519 commit 9a602a1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/platformsupport/devicediscovery/qdevicediscovery_udev.cpp
Expand Up @@ -185,11 +185,11 @@ void QDeviceDiscoveryUDev::handleUDevNotification()
// if we cannot determine a type, walk up the device tree
if (!checkDeviceType(dev)) {
// does not increase the refcount
dev = udev_device_get_parent_with_subsystem_devtype(dev, subsystem, 0);
if (!dev)
struct udev_device *parent_dev = udev_device_get_parent_with_subsystem_devtype(dev, subsystem, 0);
if (!parent_dev)
goto cleanup;

if (!checkDeviceType(dev))
if (!checkDeviceType(parent_dev))
goto cleanup;
}

Expand Down

0 comments on commit 9a602a1

Please sign in to comment.