input: fix minor data race

While usually not exposed to the user, there was a slight chance that user input was read in a dirty state.
This became apparent during usage of the new pressure sensitivity button
This commit is contained in:
Megamouse 2021-08-08 18:50:37 +02:00
parent 3fa9d23627
commit f0d51899c1
7 changed files with 69 additions and 52 deletions

View file

@ -889,7 +889,7 @@ error_code cellPadSetSensorMode(u32 port_no, u32 mode)
if (port_no >= CELL_PAD_MAX_PORT_NUM)
return CELL_OK;
const auto pad = pads[port_no];
const auto& pad = pads[port_no];
// TODO: find out if this is checked here or later or at all
if (!(pad->m_device_capability & CELL_PAD_CAPABILITY_SENSOR_MODE))
@ -993,6 +993,8 @@ error_code cellPadLddUnregisterController(s32 handle)
const auto& pads = handler->GetPads();
// TODO: check if handle >= pads.size()
if (!pads[handle]->ldd)
return CELL_PAD_ERROR_NO_DEVICE;