From: Volker Lendecke Date: Fri, 6 Aug 2021 10:14:23 +0000 (+0200) Subject: rpc_client: Simplify get_complete_frag_got_rest() X-Git-Tag: ldb-2.5.0~857 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68a3e478d1c09c337c4eb0fe4d18fa775038bb79;p=thirdparty%2Fsamba.git rpc_client: Simplify get_complete_frag_got_rest() tevent_req_simple_finish_ntstatus() is made precisely for this simple case where we just pass on a subreq's NTSTATUS Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 193a99cb6ee..dd4e29addff 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -357,17 +357,8 @@ static void get_complete_frag_got_header(struct tevent_req *subreq) static void get_complete_frag_got_rest(struct tevent_req *subreq) { - struct tevent_req *req = tevent_req_callback_data( - subreq, struct tevent_req); - NTSTATUS status; - - status = rpc_read_recv(subreq); - TALLOC_FREE(subreq); - if (!NT_STATUS_IS_OK(status)) { - tevent_req_nterror(req, status); - return; - } - tevent_req_done(req); + NTSTATUS status = rpc_read_recv(subreq); + return tevent_req_simple_finish_ntstatus(subreq, status); } static NTSTATUS get_complete_frag_recv(struct tevent_req *req)