kopia lustrzana https://github.com/espressif/esp-idf
Merge branch 'bugfix/spi_flash_ubsan_fail' into 'master'
hal: spi_flash: avoid calling memcpy with NULL buffer Closes IDFCI-737 See merge request espressif/esp-idf!14323pull/7307/head
commit
aa404750c3
|
@ -174,7 +174,9 @@ esp_err_t spi_flash_hal_common_command(spi_flash_host_inst_t *host, spi_flash_tr
|
|||
spi_flash_ll_set_miso_bitlen(dev, trans->miso_len * 8);
|
||||
spi_flash_ll_user_start(dev);
|
||||
host->driver->poll_cmd_done(host);
|
||||
spi_flash_ll_get_buffer_data(dev, trans->miso_data, trans->miso_len);
|
||||
if (trans->miso_len > 0) {
|
||||
spi_flash_ll_get_buffer_data(dev, trans->miso_data, trans->miso_len);
|
||||
}
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
|
@ -188,6 +190,8 @@ esp_err_t spi_flash_hal_read(spi_flash_host_inst_t *host, void *buffer, uint32_t
|
|||
spi_flash_ll_set_miso_bitlen(dev, read_len * 8);
|
||||
spi_flash_ll_user_start(dev);
|
||||
host->driver->poll_cmd_done(host);
|
||||
spi_flash_ll_get_buffer_data(dev, buffer, read_len);
|
||||
if (read_len > 0) {
|
||||
spi_flash_ll_get_buffer_data(dev, buffer, read_len);
|
||||
}
|
||||
return ESP_OK;
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue