From: Laurent Pinchart Date: Sat, 1 Nov 2014 13:32:28 +0000 (-0300) Subject: [media] v4l: vb2: Fix race condition in vb2_fop_poll X-Git-Tag: omap-for-v3.19/fixes-rc1~133^2~30 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f6cee18858b3c0adaa30cbe45a1766c8ef053c5d;p=pandora-kernel.git [media] v4l: vb2: Fix race condition in vb2_fop_poll The vb2_fop_poll() implementation tries to be clever on whether it needs to lock the queue mutex by checking whether polling might start fileio. The test requires reading the q->num_buffer field, which is racy if we don't hold the queue mutex in the first place. Remove the extra cleverness and just lock the mutex. Signed-off-by: Laurent Pinchart Acked-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- Reading git-diff-tree failed