Skip to content

Commit

Permalink
IFDHPowerICC: do not log an error for IFD_NO_SUCH_DEVICE
Browse files Browse the repository at this point in the history
When a reader is removed pcscd will try to cleanly close the driver and
will try to power down the card (if needed).

WriteUSB() will correctly return STATUS_NO_SUCH_DEVICE. CmdPowerOff()
will also return STATUS_NO_SUCH_DEVICE.
But IFDHPowerICC() did not correctly handled this returned value.
  • Loading branch information
LudovicRousseau committed Nov 6, 2021
1 parent 6ebc18e commit abb793b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ifdhandler.c
Original file line number Diff line number Diff line change
Expand Up @@ -1216,6 +1216,9 @@ EXTERNAL RESPONSECODE IFDHPowerICC(DWORD Lun, DWORD Action,
CcidSlots[reader_index].bPowerFlags |= MASK_POWERFLAGS_PDWN;

/* send the command */
return_value = CmdPowerOff(reader_index);
if (IFD_NO_SUCH_DEVICE == return_value)
goto end;
if (IFD_SUCCESS != CmdPowerOff(reader_index))
{
DEBUG_CRITICAL("PowerDown failed");
Expand Down

0 comments on commit abb793b

Please sign in to comment.