chiark / gitweb /
libudev: always return NULL in _unref() APIs
[elogind.git] / src / libudev / libudev-device.c
index b5b07fc5de0cd7c90e1356a35c11ccf022ee683a..059a590601d96d01f1119002baa626b15029be40 100644 (file)
@@ -1090,7 +1090,7 @@ _public_ struct udev_device *udev_device_ref(struct udev_device *udev_device)
  * Drop a reference of a udev device. If the refcount reaches zero,
  * the resources of the device will be released.
  *
- * Returns: the passed udev device if it has still an active reference, or #NULL otherwise.
+ * Returns: #NULL
  **/
 _public_ struct udev_device *udev_device_unref(struct udev_device *udev_device)
 {
@@ -1098,7 +1098,7 @@ _public_ struct udev_device *udev_device_unref(struct udev_device *udev_device)
                 return NULL;
         udev_device->refcount--;
         if (udev_device->refcount > 0)
-                return udev_device;
+                return NULL;
         if (udev_device->parent_device != NULL)
                 udev_device_unref(udev_device->parent_device);
         free(udev_device->syspath);