Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #12203 from deReeperJosh/hidv4-check-device-not-null
HIDv4: Check Device Not Null Before Attaching
  • Loading branch information
AdmiralCurtiss committed Sep 27, 2023
2 parents f844578 + d0de837 commit 467c743
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Source/Core/Core/IOS/USB/USB_HID/HIDv4.cpp
Expand Up @@ -59,6 +59,8 @@ std::optional<IPCReply> USB_HIDv4::IOCtl(const IOCtlRequest& request)
if (request.buffer_in == 0 || request.buffer_in_size != 32)
return IPCReply(IPC_EINVAL);
const auto device = GetDeviceByIOSID(memory.Read_U32(request.buffer_in + 16));
if (!device)
return IPCReply(IPC_ENOENT);
if (!device->Attach())
return IPCReply(IPC_EINVAL);
return HandleTransfer(device, request.request,
Expand Down

0 comments on commit 467c743

Please sign in to comment.