]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd/smb2_ioctl: fix error handling
authorRalph Boehme <slow@samba.org>
Tue, 9 Jun 2015 15:47:31 +0000 (17:47 +0200)
committerRalph Böhme <slow@samba.org>
Tue, 23 Jun 2015 09:45:23 +0000 (11:45 +0200)
tevent_req_nterror must be called directly as the last step before
returning with tevent_req_post.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/smbd/smb2_ioctl_network_fs.c

index 5e70703dafb41db359c3f1c0873da1463bd6fd9c..36b8e899d281ee7185646b5546ef586bde812383 100644 (file)
@@ -225,9 +225,10 @@ static struct tevent_req *fsctl_srv_copychunk_send(TALLOC_CTX *mem_ctx,
        }
 
        state->status = copychunk_check_limits(&cc_copy);
-       if (tevent_req_nterror(req, state->status)) {
+       if (!NT_STATUS_IS_OK(state->status)) {
                DEBUG(3, ("copy chunk req exceeds limits\n"));
                state->out_data = COPYCHUNK_OUT_LIMITS;
+               tevent_req_nterror(req, state->status);
                return tevent_req_post(req, ev);
        }