chiark / gitweb /
refcnt: refcnt is unsigned, fix comparisons
[elogind.git] / src / libsystemd / sd-hwdb / sd-hwdb.c
index 7444ab5f129eb7af56ac6523b89137fce2799280..a16807f9d5bb82efe18c45a5a06a65d27b9b3fb1 100644 (file)
@@ -344,7 +344,7 @@ _public_ sd_hwdb *sd_hwdb_ref(sd_hwdb *hwdb) {
 }
 
 _public_ sd_hwdb *sd_hwdb_unref(sd_hwdb *hwdb) {
-        if (hwdb && REFCNT_DEC(hwdb->n_ref) <= 0) {
+        if (hwdb && REFCNT_DEC(hwdb->n_ref) == 0) {
                 if (hwdb->map)
                         munmap((void *)hwdb->map, hwdb->st.st_size);
                 if (hwdb->f)