drivers: video: fix potential NULL pointer dereference
this bug was introduced when transitioning to k_heap usage. Signed-off-by: Jacob Siverskog <jacob@teenage.engineering>
This commit is contained in:
parent
e376b9417b
commit
393e9d4a28
1 changed files with 3 additions and 1 deletions
|
@ -65,5 +65,7 @@ void video_buffer_release(struct video_buffer *vbuf)
|
|||
}
|
||||
|
||||
vbuf->buffer = NULL;
|
||||
k_heap_free(&video_buffer_pool, block->data);
|
||||
if (block) {
|
||||
k_heap_free(&video_buffer_pool, block->data);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue