Skip to content

Commit

Permalink
fix(sd): Fix use after free
Browse files Browse the repository at this point in the history
  • Loading branch information
Ariakenom committed Aug 6, 2024
1 parent 70786dc commit 7ebb353
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libraries/SD/src/sd_diskio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -671,8 +671,10 @@ uint8_t sdcard_uninit(uint8_t pdrv) {
if (pdrv >= FF_VOLUMES || card == NULL) {
return 1;
}
AcquireSPI lock(card);
sdTransaction(pdrv, GO_IDLE_STATE, 0, NULL);
{
AcquireSPI lock(card);
sdTransaction(pdrv, GO_IDLE_STATE, 0, NULL);
}
ff_diskio_register(pdrv, NULL);
s_cards[pdrv] = NULL;
esp_err_t err = ESP_OK;
Expand Down

0 comments on commit 7ebb353

Please sign in to comment.