mirror of
https://github.com/apache/nuttx.git
synced 2026-05-20 12:33:27 +08:00
video_framebuff: Hold mutex in video_framebuff_realloc_container
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
@@ -103,8 +103,10 @@ int video_framebuff_realloc_container(video_framebuff_t *fbuf, int sz)
|
||||
{
|
||||
vbuf_container_t *vbuf;
|
||||
|
||||
nxmutex_lock(&fbuf->lock_empty);
|
||||
if (fbuf->container_size == sz)
|
||||
{
|
||||
nxmutex_unlock(&fbuf->lock_empty);
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -119,6 +121,7 @@ int video_framebuff_realloc_container(video_framebuff_t *fbuf, int sz)
|
||||
}
|
||||
else
|
||||
{
|
||||
nxmutex_unlock(&fbuf->lock_empty);
|
||||
return -ENOMEM;
|
||||
}
|
||||
}
|
||||
@@ -130,6 +133,8 @@ int video_framebuff_realloc_container(video_framebuff_t *fbuf, int sz)
|
||||
}
|
||||
|
||||
init_buf_chain(fbuf);
|
||||
nxmutex_unlock(&fbuf->lock_empty);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user