]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-device: Use hashmap_ensure_put
authorSusant Sahani <ssahani@vmware.com>
Wed, 20 Jan 2021 12:54:01 +0000 (13:54 +0100)
committerSusant Sahani <ssahani@vmware.com>
Wed, 20 Jan 2021 14:13:08 +0000 (15:13 +0100)
src/libsystemd/sd-device/device-monitor.c

index fd5900704dfce37e3cd9690d618c3e5926275b4b..72f04ee3526c6158ba295e13a3f2de07c2d43ab2 100644 (file)
@@ -732,11 +732,7 @@ _public_ int sd_device_monitor_filter_add_match_subsystem_devtype(sd_device_moni
                         return -ENOMEM;
         }
 
-        r = hashmap_ensure_allocated(&m->subsystem_filter, NULL);
-        if (r < 0)
-                return r;
-
-        r = hashmap_put(m->subsystem_filter, s, d);
+        r = hashmap_ensure_put(&m->subsystem_filter, NULL, s, d);
         if (r < 0)
                 return r;