1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 00:51:24 +03:00

sd-device: Use hashmap_ensure_put

This commit is contained in:
Susant Sahani 2021-01-20 13:54:01 +01:00
parent 875038d5fe
commit e8480482ca

View File

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