Skip to content

Commit

Permalink
Merge branch 'bugfix/spi_master_assert_failure_v5.1' into 'release/v5.1'
Browse files Browse the repository at this point in the history
spi_master: fix the assertion on a NULL desired_dev (v5.1)

See merge request espressif/esp-idf!24004
  • Loading branch information
suda-morris committed Jul 3, 2023
2 parents 32928e6 + b845c66 commit 952998a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions components/driver/spi/gpspi/spi_master.c
Original file line number Diff line number Diff line change
Expand Up @@ -725,10 +725,11 @@ static void SPI_MASTER_ISR_ATTR spi_intr(void *arg)
// We stay in the ISR to deal with those transactions of desired device, otherwise nothing will be done, check whether we need to resume some other tasks, or just quit the ISR
resume_task = spi_bus_lock_bg_check_dev_acq(lock, &desired_dev);
}
// sanity check
assert(desired_dev);

if (!resume_task) {
// sanity check
assert(desired_dev);

bool dev_has_req = spi_bus_lock_bg_check_dev_req(desired_dev);
if (dev_has_req) {
device_to_send = host->device[spi_bus_lock_get_dev_id(desired_dev)];
Expand Down

0 comments on commit 952998a

Please sign in to comment.