IOS/VEN: Return -4 when no transfer was cancelled

Simple accuracy fix.
This commit is contained in:
Léo Lam 2019-05-02 17:37:43 +02:00
parent 4c6ef81291
commit d7e23d71f8
1 changed files with 3 additions and 1 deletions
Source/Core/Core/IOS/USB/USB_VEN

View File

@ -105,7 +105,9 @@ s32 USB_VEN::SubmitTransfer(USB::Device& device, const IOCtlVRequest& ioctlv)
IPCCommandResult USB_VEN::CancelEndpoint(USBV5Device& device, const IOCtlRequest& request)
{
const u8 endpoint = static_cast<u8>(Memory::Read_U32(request.buffer_in + 8));
GetDeviceById(device.host_id)->CancelTransfer(endpoint);
// IPC_EINVAL (-4) is returned when no transfer was cancelled.
if (GetDeviceById(device.host_id)->CancelTransfer(endpoint) < 0)
return GetDefaultReply(IPC_EINVAL);
return GetDefaultReply(IPC_SUCCESS);
}