From: Laurent Pinchart Date: Fri, 26 Apr 2013 01:28:51 +0000 (-0300) Subject: [media] uvcvideo: Fix open/close race condition X-Git-Tag: v3.11-rc1~17^2~303 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=17706f5653a90ff277b5b36c2eb60ff872df5e7a;p=pandora-kernel.git [media] uvcvideo: Fix open/close race condition Maintaining the users count using an atomic variable makes sure that access to the counter won't be racy, but doesn't serialize access to the operations protected by the counter. This creates a race condition that could result in the status URB being submitted multiple times. Use a mutex to protect the users count and serialize access to the status start and stop operations. Reported-by: Shawn Nematbakhsh Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab --- Reading git-diff-tree failed