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

network: mdb - use hashmap_ensure_put

This commit is contained in:
Susant Sahani 2021-01-14 06:54:47 +01:00 committed by Susant Sahani
parent 190b3b5c30
commit f222165e3d

View File

@ -70,11 +70,7 @@ static int mdb_entry_new_static(
.section = TAKE_PTR(n),
};
r = hashmap_ensure_allocated(&network->mdb_entries_by_section, &network_config_hash_ops);
if (r < 0)
return r;
r = hashmap_put(network->mdb_entries_by_section, mdb_entry->section, mdb_entry);
r = hashmap_ensure_put(&network->mdb_entries_by_section, &network_config_hash_ops, mdb_entry->section, mdb_entry);
if (r < 0)
return r;