Merge branch 'collectd-5.4' into collectd-5.5
[collectd.git] / src / smart.c
index f0c189e..2207bd6 100644 (file)
@@ -109,7 +109,7 @@ static void smart_handle_disk_attribute(SkDisk *d, const SkSmartAttributeParsedD
 
   plugin_dispatch_values (&vl);
 
-  if (a->threshold_valid && a->current_value < a->threshold)
+  if (a->threshold_valid && a->current_value <= a->threshold)
   {
     notification_t notif = { NOTIF_WARNING,
                              cdtime (),
@@ -253,6 +253,7 @@ static int smart_read (void)
 
     /* Query status with libatasmart */
     smart_handle_disk (devpath);
+    udev_device_unref (dev);
   }
 
   udev_enumerate_unref (enumerate);