From ebffea2a253e7f5a38b91d826570d68fa56dbda7 Mon Sep 17 00:00:00 2001 From: Susant Sahani Date: Sun, 17 Jan 2021 12:07:02 +0100 Subject: network: Use ordered_hashmap_ensure_put (#18233) --- src/network/tc/qdisc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/network/tc/qdisc.c') diff --git a/src/network/tc/qdisc.c b/src/network/tc/qdisc.c index 1a84e8b0f5..7016dc1877 100644 --- a/src/network/tc/qdisc.c +++ b/src/network/tc/qdisc.c @@ -126,11 +126,7 @@ int qdisc_new_static(QDiscKind kind, Network *network, const char *filename, uns qdisc->network = network; qdisc->section = TAKE_PTR(n); - r = ordered_hashmap_ensure_allocated(&network->tc_by_section, &network_config_hash_ops); - if (r < 0) - return r; - - r = ordered_hashmap_put(network->tc_by_section, qdisc->section, TC(qdisc)); + r = ordered_hashmap_ensure_put(&network->tc_by_section, &network_config_hash_ops, qdisc->section, TC(qdisc)); if (r < 0) return r; -- cgit v1.2.3