s4:rpc_server: inline the dcesrv_assoc_group_find function
authorSamuel Cabrero <scabrero@samba.org>
Thu, 3 Oct 2019 15:26:54 +0000 (17:26 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 18 Oct 2019 16:07:37 +0000 (16:07 +0000)
Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source4/rpc_server/dcerpc_server.c

index fc8979deaa43e5911ec466da39b780d47ead2650..39a25241316405e972e7942b13ac96edffe969cd 100644 (file)
@@ -46,21 +46,6 @@ static NTSTATUS dcesrv_negotiate_contexts(struct dcesrv_call_state *call,
                                const struct dcerpc_bind *b,
                                struct dcerpc_ack_ctx *ack_ctx_list);
 
-/*
-  find an association group given a assoc_group_id
- */
-static struct dcesrv_assoc_group *dcesrv_assoc_group_find(struct dcesrv_context *dce_ctx,
-                                                         uint32_t id)
-{
-       void *id_ptr;
-
-       id_ptr = idr_find(dce_ctx->assoc_groups_idr, id);
-       if (id_ptr == NULL) {
-               return NULL;
-       }
-       return talloc_get_type_abort(id_ptr, struct dcesrv_assoc_group);
-}
-
 /*
   take a reference to an existing association group
  */
@@ -71,12 +56,16 @@ static struct dcesrv_assoc_group *dcesrv_assoc_group_reference(struct dcesrv_con
        enum dcerpc_transport_t transport =
                dcerpc_binding_get_transport(endpoint->ep_description);
        struct dcesrv_assoc_group *assoc_group;
+       void *id_ptr = NULL;
 
-       assoc_group = dcesrv_assoc_group_find(conn->dce_ctx, id);
-       if (assoc_group == NULL) {
+       /* find an association group given a assoc_group_id */
+       id_ptr = idr_find(conn->dce_ctx->assoc_groups_idr, id);
+       if (id_ptr == NULL) {
                DBG_NOTICE("Failed to find assoc_group 0x%08x\n", id);
                return NULL;
        }
+       assoc_group = talloc_get_type_abort(id_ptr, struct dcesrv_assoc_group);
+
        if (assoc_group->transport != transport) {
                const char *at =
                        derpc_transport_string_by_transport(