From aa20b1e8bdce1f0bb6df1c52551153a92cd81e9b Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sun, 4 Dec 2022 22:36:26 +0800 Subject: [PATCH] drivers/video: Zero all video_framebuff_t fields in video_framebuff_init Signed-off-by: Xiang Xiao --- drivers/video/video_framebuff.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/video/video_framebuff.c b/drivers/video/video_framebuff.c index cfc1f3ae0ac..08095216eb9 100644 --- a/drivers/video/video_framebuff.c +++ b/drivers/video/video_framebuff.c @@ -97,12 +97,8 @@ static inline vbuf_container_t *dequeue_vbuf_unsafe(video_framebuff_t *fbuf) void video_framebuff_init(video_framebuff_t *fbuf) { - fbuf->mode = V4L2_BUF_MODE_RING; - fbuf->vbuf_empty = NULL; - fbuf->vbuf_top = NULL; - fbuf->vbuf_tail = NULL; - fbuf->vbuf_next = NULL; - + memset(fbuf, 0, sizeof(video_framebuff_t)); + fbuf->mode = V4L2_BUF_MODE_RING; nxmutex_init(&fbuf->lock_empty); }