kopia lustrzana https://github.com/espressif/esp-idf
driver: fix issues reported by PVS-Studio
https://www.viva64.com/en/b/0790/#ID88049D3FA2 https://www.viva64.com/en/b/0790/#IDE0890EE01C Reported in https://github.com/espressif/esp-idf/issues/6440pull/11508/head
rodzic
98e19b3355
commit
0fe3281713
|
@ -942,15 +942,19 @@ static esp_err_t ledc_fade_channel_init_check(ledc_mode_t speed_mode, ledc_chann
|
|||
if (s_ledc_fade_rec[speed_mode][channel] == NULL) {
|
||||
#if CONFIG_SPIRAM_USE_MALLOC
|
||||
s_ledc_fade_rec[speed_mode][channel] = (ledc_fade_t *) heap_caps_calloc(1, sizeof(ledc_fade_t), MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
|
||||
if (!s_ledc_fade_rec[speed_mode][channel]) {
|
||||
if (s_ledc_fade_rec[speed_mode][channel] == NULL) {
|
||||
ledc_fade_channel_deinit(speed_mode, channel);
|
||||
return ESP_FAIL;
|
||||
return ESP_ERR_NO_MEM;
|
||||
}
|
||||
|
||||
memset(&s_ledc_fade_rec[speed_mode][channel]->ledc_fade_sem_storage, 0, sizeof(StaticQueue_t));
|
||||
s_ledc_fade_rec[speed_mode][channel]->ledc_fade_sem = xSemaphoreCreateBinaryStatic(&s_ledc_fade_rec[speed_mode][channel]->ledc_fade_sem_storage);
|
||||
#else
|
||||
s_ledc_fade_rec[speed_mode][channel] = (ledc_fade_t *) calloc(1, sizeof(ledc_fade_t));
|
||||
if (s_ledc_fade_rec[speed_mode][channel] == NULL) {
|
||||
ledc_fade_channel_deinit(speed_mode, channel);
|
||||
return ESP_ERR_NO_MEM;
|
||||
}
|
||||
s_ledc_fade_rec[speed_mode][channel]->ledc_fade_sem = xSemaphoreCreateBinary();
|
||||
#endif
|
||||
s_ledc_fade_rec[speed_mode][channel]->ledc_fade_mux = xSemaphoreCreateMutex();
|
||||
|
|
|
@ -403,10 +403,6 @@ esp_err_t sdio_slave_start(void)
|
|||
critical_enter_recv();
|
||||
sdio_slave_hal_recv_start(context.hal);
|
||||
critical_exit_recv();
|
||||
ret = ESP_OK;
|
||||
if (ret != ESP_OK) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
sdio_slave_hal_set_ioready(context.hal, true);
|
||||
return ESP_OK;
|
||||
|
|
Ładowanie…
Reference in New Issue