From 0720fc8a1702d07fb14b68d4054d2e128b5062a1 Mon Sep 17 00:00:00 2001 From: Jarno Lamsa Date: Tue, 30 Oct 2018 15:25:35 +0200 Subject: [PATCH] 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. --- components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp b/components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp index 18759dcc79..24f1f129c5 100644 --- a/components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp +++ b/components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp @@ -892,7 +892,6 @@ int SDBlockDevice::_read(uint8_t *buffer, uint32_t length) // read until start byte (0xFE) if (false == _wait_token(SPI_START_BLOCK)) { debug_if(SD_DBG, "Read timeout\n"); - _deselect(); return SD_BLOCK_DEVICE_ERROR_NO_RESPONSE; }