From: Susant Sahani Date: Thu, 14 Jan 2021 05:00:53 +0000 (+0100) Subject: homed: use ordered_set_ensure_put X-Git-Tag: v248-rc1~323^2~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65ca9b53431aa4c75f9cb1436586655847ed78b7;p=thirdparty%2Fsystemd.git homed: use ordered_set_ensure_put --- diff --git a/src/home/homed-home.c b/src/home/homed-home.c index 7f4532e0cc7..38b7e20ca61 100644 --- a/src/home/homed-home.c +++ b/src/home/homed-home.c @@ -2656,11 +2656,7 @@ int home_schedule_operation(Home *h, Operation *o, sd_bus_error *error) { if (ordered_set_size(h->pending_operations) >= PENDING_OPERATIONS_MAX) return sd_bus_error_setf(error, BUS_ERROR_TOO_MANY_OPERATIONS, "Too many client operations requested"); - r = ordered_set_ensure_allocated(&h->pending_operations, &operation_hash_ops); - if (r < 0) - return r; - - r = ordered_set_put(h->pending_operations, o); + r = ordered_set_ensure_put(&h->pending_operations, &operation_hash_ops, o); if (r < 0) return r;