If user space only queue one buffer into ready list, and
call streamon, camera csi enc ISR will crash.
Since for CSI ENC, the ping pong buffer is initilized without
checking ready buffer on streamon.
The second buffer will be wrongly in cam_data struct, and causes
DMA fill buffers into cam_data global variable.
Here just add one sanity check for ready buffer.
Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
"queued yet\n");
return -EINVAL;
}
+ if (cam->enc_update_eba &&
+ cam->ready_q.prev == cam->ready_q.next) {
+ pr_err("ERROR: v4l2 capture: mxc_streamon buffer need ping pong "
+ "at least two buffers\n");
+ return -EINVAL;
+ }
cam->capture_pid = current->pid;