diff options
| author | Dan Carpenter <[email protected]> | 2023-06-14 16:05:39 +0300 |
|---|---|---|
| committer | Hans Verkuil <[email protected]> | 2023-07-25 10:35:00 +0200 |
| commit | be40f524b6edac4fb9a98ef79620fd9b9497a998 (patch) | |
| tree | 9ef39e0a4494d0fcc52595ffb3298005bb199ec5 /tools/perf/scripts/python/export-to-sqlite.py | |
| parent | dfa2d6e07432270330ae191f50a0e70636a4cd2b (diff) | |
media: mediatek: vcodec: fix potential double free
The "lat_buf->private_data" needs to be set to NULL to prevent a
double free. How this would happen is if vdec_msg_queue_init() failed
twice in a row and on the second time it failed earlier than on the
first time.
The vdec_msg_queue_init() function has a loop which does:
for (i = 0; i < NUM_BUFFER_COUNT; i++) {
Each iteration initializes one element in the msg_queue->lat_buf[] array
and then the clean up function vdec_msg_queue_deinit() frees each
element of the msg_queue->lat_buf[] array. This clean up code relies
on the assumption that every element is either initialized or zeroed.
Leaving a freed pointer which is non-zero breaks the assumption.
Fixes: b199fe46f35c ("media: mtk-vcodec: Add msg queue feature for lat and core architecture")
Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: Nicolas Dufresne <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions