提交 0f890ab1 编写于 作者: A Andy Walls 提交者: Mauro Carvalho Chehab

[media] cx18: Fix list BUG for IDX stream, triggerable in cx18_probe() error clean up,

If allocating stream buffers for one of the primary streams (e.g. YUV)
failed during card probe, the error path clean up would try to manipulate
the yet unitialized IDX stream structures.  This caused a BUG due to
unitialized list heads.

Detect that case and ignore the uninitialized IDX stream.
Signed-off-by: NAndy Walls <awalls@md.metrocast.net>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 974ceab8
......@@ -350,9 +350,17 @@ void cx18_streams_cleanup(struct cx18 *cx, int unregister)
/* No struct video_device, but can have buffers allocated */
if (type == CX18_ENC_STREAM_TYPE_IDX) {
/* If the module params didn't inhibit IDX ... */
if (cx->stream_buffers[type] != 0) {
cx->stream_buffers[type] = 0;
cx18_stream_free(&cx->streams[type]);
/*
* Before calling cx18_stream_free(),
* check if the IDX stream was actually set up.
* Needed, since the cx18_probe() error path
* exits through here as well as normal clean up
*/
if (cx->streams[type].buffers != 0)
cx18_stream_free(&cx->streams[type]);
}
continue;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册