From: Laurent Pinchart Date: Sat, 1 Nov 2014 13:32:28 +0000 (-0300) Subject: [media] v4l: vb2: Fix race condition in _vb2_fop_release X-Git-Tag: omap-for-v3.19/fixes-rc1~133^2~29 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69c0e9c547817fef14871bc5c4645fad683f242e;p=pandora-kernel.git [media] v4l: vb2: Fix race condition in _vb2_fop_release The function releases the queue if the file being released is the queue owner. The check reads the queue->owner field without taking the queue lock, creating a race condition with functions that set the queue owner, such as vb2_ioctl_reqbufs() for instance. Fix this by moving the queue->owner check within the mutex protected section. Signed-off-by: Laurent Pinchart Acked-by: Hans Verkuil Acked-by: Sylwester Nawrocki Signed-off-by: Mauro Carvalho Chehab --- Reading git-diff-tree failed