From: Susant Sahani Date: Wed, 20 Jan 2021 12:54:01 +0000 (+0100) Subject: sd-device: Use hashmap_ensure_put X-Git-Tag: v248-rc1~286^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e8480482ca3fe014f42e6aeb59c734d8af44432e;p=thirdparty%2Fsystemd.git sd-device: Use hashmap_ensure_put --- diff --git a/src/libsystemd/sd-device/device-monitor.c b/src/libsystemd/sd-device/device-monitor.c index fd5900704df..72f04ee3526 100644 --- a/src/libsystemd/sd-device/device-monitor.c +++ b/src/libsystemd/sd-device/device-monitor.c @@ -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;