mirror of https://github.com/ARMmbed/mbed-os.git
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
parent
728e23b821
commit
0720fc8a17
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue