From: Samuel Cabrero Date: Thu, 3 Oct 2019 15:26:54 +0000 (+0200) Subject: s4:rpc_server: inline the dcesrv_assoc_group_find function X-Git-Tag: talloc-2.3.1~304 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b0ecc8ef55dc7e8c7ce9f7f3ca325358f62debfb;p=thirdparty%2Fsamba.git s4:rpc_server: inline the dcesrv_assoc_group_find function Signed-off-by: Samuel Cabrero Reviewed-by: Andrew Bartlett Reviewed-by: Andreas Schneider --- diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c index fc8979deaa4..39a25241316 100644 --- a/source4/rpc_server/dcerpc_server.c +++ b/source4/rpc_server/dcerpc_server.c @@ -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(