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:
parent
190b3b5c30
commit
f222165e3d
@ -70,11 +70,7 @@ static int mdb_entry_new_static(
|
|||||||
.section = TAKE_PTR(n),
|
.section = TAKE_PTR(n),
|
||||||
};
|
};
|
||||||
|
|
||||||
r = hashmap_ensure_allocated(&network->mdb_entries_by_section, &network_config_hash_ops);
|
r = hashmap_ensure_put(&network->mdb_entries_by_section, &network_config_hash_ops, mdb_entry->section, mdb_entry);
|
||||||
if (r < 0)
|
|
||||||
return r;
|
|
||||||
|
|
||||||
r = hashmap_put(network->mdb_entries_by_section, mdb_entry->section, mdb_entry);
|
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user