From: Jean-François Moine Date: Tue, 6 Jul 2010 07:16:40 +0000 (-0300) Subject: V4L/DVB: gspca - main: Possible race condition in queue management X-Git-Tag: v2.6.36-rc1~582^2~68 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02bbcb9d863df10b5a4b91ba5b4c76eaf1340883;p=pandora-kernel.git V4L/DVB: gspca - main: Possible race condition in queue management The problem may occur with SMP: - a frame is completed at interrupt level (in gspca_frame_add with packet_type == LAST_PACKET, - just after clearing the bit V4L2_BUF_FLAG_QUEUED and before setting the bit V4L2_BUF_FLAG_DONE, on the other processor, the application tries to requeue the same frame buffer, - then, the qbuf function succeeds because ALL_FLAGS are not set. The fix sets and resets the two flags in one instruction. Reported-by: Hans de Goede Signed-off-by: Jean-François Moine Signed-off-by: Mauro Carvalho Chehab --- Reading git-diff-tree failed