video_framebuff: Hold mutex in video_framebuff_realloc_container
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
efee5f86e8
commit
0db82210fd
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user