From 86be09ac0bc87f081a1e8abc7f43ed3e98ffb9c2 Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Fri, 24 Jun 2022 20:38:02 -0500 Subject: [PATCH] ntdll: Do not fill the IOSB or signal completion on failure in tape_DeviceIoControl(). We should never fill the IOSB or signal completion for NT_ERROR conditions. --- dlls/ntdll/unix/tape.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/dlls/ntdll/unix/tape.c b/dlls/ntdll/unix/tape.c index 48807dbca7a..f513e558898 100644 --- a/dlls/ntdll/unix/tape.c +++ b/dlls/ntdll/unix/tape.c @@ -528,9 +528,8 @@ NTSTATUS tape_DeviceIoControl( HANDLE device, HANDLE event, PIO_APC_ROUTINE apc, TRACE( "%p %s %p %d %p %d %p\n", device, io2str(code), in_buffer, in_size, out_buffer, out_size, io ); - io->Information = 0; - - if ((status = server_get_unix_fd( device, 0, &fd, &needs_close, NULL, NULL ))) goto error; + if ((status = server_get_unix_fd( device, 0, &fd, &needs_close, NULL, NULL ))) + return status; switch (code) { @@ -580,9 +579,11 @@ NTSTATUS tape_DeviceIoControl( HANDLE device, HANDLE event, PIO_APC_ROUTINE apc, if (needs_close) close( fd ); -error: - io->Status = status; - io->Information = sz; - if (event) NtSetEvent( event, NULL ); + if (!NT_ERROR(status)) + { + io->Status = status; + io->Information = sz; + if (event) NtSetEvent( event, NULL ); + } return status; } -- 2.11.4.GIT