Remove extra _deselect to prevent possible hard fault

If read timeout happens, the _deselect will get called twice causing
a hard fault happening when mutex is released without being locked.
The SDBlockDevice::read is calling the _deselect in every case.
pull/8775/head
Jarno Lamsa 2018-10-30 15:25:35 +02:00 committed by adbridge
parent 728e23b821
commit 0720fc8a17
1 changed files with 0 additions and 1 deletions

View File

@ -892,7 +892,6 @@ int SDBlockDevice::_read(uint8_t *buffer, uint32_t length)
// read until start byte (0xFE) // read until start byte (0xFE)
if (false == _wait_token(SPI_START_BLOCK)) { if (false == _wait_token(SPI_START_BLOCK)) {
debug_if(SD_DBG, "Read timeout\n"); debug_if(SD_DBG, "Read timeout\n");
_deselect();
return SD_BLOCK_DEVICE_ERROR_NO_RESPONSE; return SD_BLOCK_DEVICE_ERROR_NO_RESPONSE;
} }