kernel: guard vb2 queue before stream
This commit is contained in:
parent
ffc79982fc
commit
213673274d
@ -42,6 +42,22 @@
|
|||||||
+ video->uvc_num_requests, video->reqs_per_frame,
|
+ video->uvc_num_requests, video->reqs_per_frame,
|
||||||
+ video->queue.use_sg, video->queue.flags);
|
+ video->queue.use_sg, video->queue.flags);
|
||||||
+
|
+
|
||||||
|
@@ -807,6 +820,15 @@
|
||||||
|
video->is_enabled = true;
|
||||||
|
|
||||||
|
+ if (!video->queue.queue.lock || !video->queue.queue.ops ||
|
||||||
|
+ !video->queue.queue.mem_ops) {
|
||||||
|
+ uvcg_err(&video->uvc->func,
|
||||||
|
+ "Video queue not ready: dev=%p lock=%p ops=%p mem_ops=%p buf_ops=%p drv_priv=%p type=%u io_modes=0x%x\n",
|
||||||
|
+ video->queue.queue.dev, video->queue.queue.lock,
|
||||||
|
+ video->queue.queue.ops, video->queue.queue.mem_ops,
|
||||||
|
+ video->queue.queue.buf_ops, video->queue.queue.drv_priv,
|
||||||
|
+ video->queue.queue.type, video->queue.queue.io_modes);
|
||||||
|
+ return -EINVAL;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if ((ret = uvcg_queue_enable(&video->queue, 1)) < 0)
|
||||||
|
return ret;
|
||||||
/*
|
/*
|
||||||
* Safe to access request related fields without req_lock because
|
* Safe to access request related fields without req_lock because
|
||||||
* this is the only thread currently active, and no other
|
* this is the only thread currently active, and no other
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user