diff --git a/targets/TARGET_STM/TARGET_STM32F7/device/stm32f7xx_hal_cryp.c b/targets/TARGET_STM/TARGET_STM32F7/device/stm32f7xx_hal_cryp.c index 0c0f71a8d0..36892d6297 100644 --- a/targets/TARGET_STM/TARGET_STM32F7/device/stm32f7xx_hal_cryp.c +++ b/targets/TARGET_STM/TARGET_STM32F7/device/stm32f7xx_hal_cryp.c @@ -1021,10 +1021,6 @@ HAL_StatusTypeDef HAL_CRYP_Encrypt(CRYP_HandleTypeDef *hcryp, uint32_t *Input, u default: hcryp->ErrorCode |= HAL_CRYP_ERROR_NOT_SUPPORTED; - - /* Process unlocked */ - __HAL_UNLOCK(hcryp); // MBED patch - return HAL_ERROR; } @@ -1061,10 +1057,6 @@ HAL_StatusTypeDef HAL_CRYP_Encrypt(CRYP_HandleTypeDef *hcryp, uint32_t *Input, u default: hcryp->ErrorCode |= HAL_CRYP_ERROR_NOT_SUPPORTED; - - /* Process unlocked */ - __HAL_UNLOCK(hcryp); // MBED patch - return HAL_ERROR; } #endif /*end AES or CRYP */ @@ -1073,10 +1065,10 @@ HAL_StatusTypeDef HAL_CRYP_Encrypt(CRYP_HandleTypeDef *hcryp, uint32_t *Input, u { /* Change the CRYP peripheral state */ hcryp->State = HAL_CRYP_STATE_READY; - } - + /* Process unlocked */ - __HAL_UNLOCK(hcryp); // MBED patch + __HAL_UNLOCK(hcryp); + } } else { @@ -1194,10 +1186,6 @@ HAL_StatusTypeDef HAL_CRYP_Decrypt(CRYP_HandleTypeDef *hcryp, uint32_t *Input, u default: hcryp->ErrorCode |= HAL_CRYP_ERROR_NOT_SUPPORTED; - - /* Process unlocked */ - __HAL_UNLOCK(hcryp); // MBED patch - return HAL_ERROR; } @@ -1242,10 +1230,10 @@ HAL_StatusTypeDef HAL_CRYP_Decrypt(CRYP_HandleTypeDef *hcryp, uint32_t *Input, u { /* Change the CRYP peripheral state */ hcryp->State = HAL_CRYP_STATE_READY; + + /* Process unlocked */ + __HAL_UNLOCK(hcryp); } - - /* Process unlocked */ - __HAL_UNLOCK(hcryp); // MBED patch } else {