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:
Jacob Siverskog 2020-12-10 19:38:50 +01:00 committed by Maureen Helm
commit 393e9d4a28

View file

@ -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);
}
}