提交 2e7682eb 编写于 作者: Y YueHaibing 提交者: Mauro Carvalho Chehab

media: tw5864: Fix possible NULL pointer dereference in tw5864_handle_frame

'vb' null check should be done before dereferencing it in
tw5864_handle_frame, otherwise a NULL pointer dereference
may occur.

Fixes: 34d1324e ("[media] pci: Add tw5864 driver")
Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
Signed-off-by: NHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
上级 f8ee34c3
......@@ -1395,13 +1395,13 @@ static void tw5864_handle_frame(struct tw5864_h264_frame *frame)
input->vb = NULL;
spin_unlock_irqrestore(&input->slock, flags);
v4l2_buf = to_vb2_v4l2_buffer(&vb->vb.vb2_buf);
if (!vb) { /* Gone because of disabling */
dev_dbg(&dev->pci->dev, "vb is empty, dropping frame\n");
return;
}
v4l2_buf = to_vb2_v4l2_buffer(&vb->vb.vb2_buf);
/*
* Check for space.
* Mind the overhead of startcode emulation prevention.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册