Skip to content

Commit abb3c2a

Browse files
mariopajakartben
authored andcommitted
drivers: i2s: stm32_sai fix tx callback mem_block release
This change fixes a wrong buffer release on tx callback which was not correctly fixed by #94696. Signed-off-by: Mario Paja <[email protected]>
1 parent 2581729 commit abb3c2a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/i2s/i2s_stm32_sai.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ void HAL_SAI_TxCpltCallback(SAI_HandleTypeDef *hsai)
133133
{
134134
struct i2s_stm32_sai_data *dev_data = CONTAINER_OF(hsai, struct i2s_stm32_sai_data, hsai);
135135
struct stream *stream = &dev_data->stream;
136+
void *mem_block_tmp = stream->mem_block;
136137
struct queue_item item;
137138
int ret;
138139

@@ -183,7 +184,7 @@ void HAL_SAI_TxCpltCallback(SAI_HandleTypeDef *hsai)
183184

184185
exit:
185186
/* Free memory slab & exit */
186-
k_mem_slab_free(stream->i2s_cfg.mem_slab, stream->mem_block);
187+
k_mem_slab_free(stream->i2s_cfg.mem_slab, mem_block_tmp);
187188
}
188189

189190
void HAL_SAI_ErrorCallback(SAI_HandleTypeDef *hsai)

0 commit comments

Comments
 (0)