v4l2: fix race condition
authorRob Clark <rob@ti.com>
Sun, 4 Apr 2010 11:39:52 +0000 (06:39 -0500)
committerRob Clark <rob@ti.com>
Wed, 29 Dec 2010 17:46:41 +0000 (11:46 -0600)
commitc3721534c9ede49b9482b2065b591a05c495bb30
tree453818bc556f6800a46e94468d64ae2241f5f413
parent34e448980b4de9afff83c674a4d46178fa999611
v4l2: fix race condition

The size of the buffer would be zero'd out in gst_v4l2_buffer_finalize()
after the buffer is qbuf'd or pushed onto the queue of available buffers..
leaving a race condition where the thread waiting for the buffer could awake
and set back a valid size before the finalizing thread zeros out the length.
This would result that the newly allocated buffer has length of zero.
sys/v4l2/gstv4l2bufferpool.c